17 changes: 17 additions & 0 deletions clang/test/Modules/pch_container.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@import DependsOnModule;
// REQUIRES: x86-registered-target
// RUN: rm -rf %t-MachO %t-ELF %t-ELF_SPLIT %t-COFF
// RUN: %clang_cc1 -triple=x86_64-apple-darwin -fmodules -fimplicit-module-maps -fdisable-module-hash -fmodules-cache-path=%t-MachO -F %S/Inputs %s
// RUN: %clang_cc1 -triple=x86_64-linux-elf -fmodules -fimplicit-module-maps -fdisable-module-hash -fmodules-cache-path=%t-ELF -F %S/Inputs %s
// RUN: %clang_cc1 -triple=x86_64-windows-coff -fmodules -fimplicit-module-maps -fdisable-module-hash -fmodules-cache-path=%t-COFF -F %S/Inputs %s

// RUN: llvm-objdump -section-headers %t-MachO/DependsOnModule.pcm %t-ELF/DependsOnModule.pcm %t-COFF/DependsOnModule.pcm | FileCheck %s
// CHECK: file format Mach-O 64-bit x86-64
// CHECK: __clangast {{[0-9a-f]+}} {{[0-9a-f]+}} DATA
// CHECK: file format ELF64-x86-64
// CHECK: __clangast {{[0-9a-f]+}} {{[0-9a-f]+}} DATA
// CHECK: file format COFF-x86-64
// CHECK: clangast {{[0-9a-f]+}} {{[0-9a-f]+}}


// RUN: %clang_cc1 -split-dwarf-file t-split.dwo -triple=x86_64-linux-elf -fmodules -fimplicit-module-maps -fdisable-module-hash -fmodules-cache-path=%t-ELF_SPLIT -F %S/Inputs %s -o %t-split.o
2 changes: 1 addition & 1 deletion clang/test/Modules/self-import-header.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// rdar://13840148

// REQUIRES: x86-registered-target
// RUN: rm -rf %t
// RUN: %clang -fsyntax-only -isysroot %S/Inputs/System/usr/include -fmodules -fmodules-cache-path=%t \
// RUN: -target x86_64-darwin \
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Modules/templates-2.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -x objective-c++ -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -verify %s -Wno-objc-root-class
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -x objective-c++ -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -emit-llvm %s -o - -Wno-objc-root-class | FileCheck %s
// expected-no-diagnostics

// REQUIRES: x86-registered-target
@import templates_top;

struct TestEmitDefaultedSpecialMembers {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Modules/templates.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -x objective-c++ -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -verify %s -Wno-objc-root-class
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -x objective-c++ -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs -emit-llvm %s -o - -Wno-objc-root-class | FileCheck %s
// expected-no-diagnostics

// REQUIRES: x86-registered-target
@import templates_left;

void testInlineRedeclEarly() {
Expand Down
1 change: 1 addition & 0 deletions clang/test/Modules/va_list.m
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// REQUIRES: x86-registered-target
// RUN: rm -rf %t
// RUN: %clang_cc1 -triple x86_64-apple-macosx10 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
// RUN: -fmodules-ignore-macro=PREFIX -DPREFIX -I %S/Inputs/va_list \
Expand Down
2 changes: 1 addition & 1 deletion clang/test/OpenMP/atomic_read_codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %clang_cc1 -fopenmp -x c -triple x86_64-apple-darwin10 -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp -x c -triple x86_64-apple-darwin10 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
// expected-no-diagnostics

// REQUIRES: x86-registered-target
#ifndef HEADER
#define HEADER

Expand Down
2 changes: 1 addition & 1 deletion clang/test/OpenMP/barrier_codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
// expected-no-diagnostics

// REQUIRES: x86-registered-target
#ifndef HEADER
#define HEADER

Expand Down
2 changes: 1 addition & 1 deletion clang/test/OpenMP/critical_codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
// expected-no-diagnostics

// REQUIRES: x86-registered-target
#ifndef HEADER
#define HEADER

Expand Down
2 changes: 1 addition & 1 deletion clang/test/OpenMP/flush_codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -g -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
// expected-no-diagnostics

// REQUIRES: x86-registered-target
#ifndef HEADER
#define HEADER

Expand Down
2 changes: 1 addition & 1 deletion clang/test/OpenMP/for_codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
//
// expected-no-diagnostics
// REQUIRES: x86-registered-target
#ifndef HEADER
#define HEADER

// CHECK: [[IDENT_T_TY:%.+]] = type { i32, i32, i32, i32, i8* }
// CHECK-DAG: [[IMPLICIT_BARRIER_LOC:@.+]] = private unnamed_addr constant %{{.+}} { i32 0, i32 66, i32 0, i32 0, i8*
// CHECK-DAG: [[I:@.+]] = global i8 1,
Expand Down
2 changes: 1 addition & 1 deletion clang/test/OpenMP/master_codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
// expected-no-diagnostics

// REQUIRES: x86-registered-target
#ifndef HEADER
#define HEADER

Expand Down
2 changes: 1 addition & 1 deletion clang/test/OpenMP/parallel_codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -g -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck --check-prefix=CHECK-DEBUG %s
// expected-no-diagnostics
// REQUIRES: x86-registered-target
#ifndef HEADER
#define HEADER

// CHECK-DAG: %ident_t = type { i32, i32, i32, i32, i8* }
// CHECK-DAG: %struct.anon = type { i32* }
// CHECK-DAG: %struct.anon.0 = type { i8*** }
Expand Down
2 changes: 1 addition & 1 deletion clang/test/OpenMP/parallel_private_codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DLAMBDA -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=LAMBDA %s
// RUN: %clang_cc1 -verify -fopenmp -x c++ -fblocks -DBLOCKS -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck -check-prefix=BLOCKS %s
// expected-no-diagnostics
// REQUIRES: x86-registered-target
#ifndef HEADER
#define HEADER

template <class T>
struct S {
T f;
Expand Down
2 changes: 1 addition & 1 deletion clang/test/OpenMP/simd_codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -g -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
//
// REQUIRES: x86-registered-target
// expected-no-diagnostics
#ifndef HEADER
#define HEADER
Expand Down
2 changes: 1 addition & 1 deletion clang/test/OpenMP/single_codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// RUN: %clang_cc1 -verify -triple x86_64-apple-darwin10 -fopenmp -fexceptions -fcxx-exceptions -gline-tables-only -x c++ -emit-llvm %s -o - | FileCheck %s --check-prefix=TERM_DEBUG
// RUN: %clang_cc1 -verify -fopenmp -x c++ -std=c++11 -DARRAY -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -check-prefix=ARRAY %s
// expected-no-diagnostics

// REQUIRES: x86-registered-target
#ifndef ARRAY
#ifndef HEADER
#define HEADER
Expand Down
2 changes: 1 addition & 1 deletion clang/test/OpenMP/taskyield_codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
// RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s
// expected-no-diagnostics

// REQUIRES: x86-registered-target
#ifndef HEADER
#define HEADER

Expand Down
2 changes: 1 addition & 1 deletion clang/test/OpenMP/threadprivate_codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// CHECK-DEBUG-DAG: [[S4:%.+]] = type { [[INT]], [[INT]] }
// CHECK-DEBUG-DAG: [[S5:%.+]] = type { [[INT]], [[INT]], [[INT]] }
// CHECK-DEBUG-DAG: [[SMAIN:%.+]] = type { [[INT]], double, double }

// REQUIRES: x86-registered-target
struct S1 {
int a;
S1()
Expand Down
1 change: 1 addition & 0 deletions clang/test/PCH/__va_list_tag.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// REQUIRES: x86-registered-target
// PR13189
// rdar://problem/11741429
// Test this without pch.
Expand Down
1 change: 1 addition & 0 deletions clang/test/PCH/arc.m
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// REQUIRES: x86-registered-target
// Test this without pch.
// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin11 -fobjc-arc -include %S/Inputs/arc.h -fsyntax-only -emit-llvm-only %s

Expand Down
1 change: 1 addition & 0 deletions clang/test/PCH/asm.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// REQUIRES: x86-registered-target
// Test this without pch.
// RUN: %clang_cc1 -triple i386-unknown-unknown -include %S/asm.h -fsyntax-only -verify %s

Expand Down
1 change: 1 addition & 0 deletions clang/test/PCH/chain-external-defs.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// REQUIRES: x86-registered-target
// Test with pch.
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t1.pch %S/Inputs/chain-external-defs1.h
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t2.pch %S/Inputs/chain-external-defs2.h -include-pch %t1.pch
Expand Down
1 change: 1 addition & 0 deletions clang/test/PCH/chain-trivial.c
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
// REQUIRES: x86-registered-target
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-pch -o %t1 %S/Inputs/chain-trivial1.h
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-pch -o %t2 -include-pch %t1 %S/Inputs/chain-trivial2.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// REQUIRES: x86-registered-target
// RUN: %clang_cc1 -fms-extensions -triple i386-unknown-unknown -x c++-header -emit-pch -o %t %S/cxx-ms-function-specialization-class-scope.h
// RUN: %clang_cc1 -fms-extensions -triple i386-unknown-unknown -include-pch %t -fsyntax-only -verify %s
// expected-no-diagnostics
Expand Down
1 change: 1 addition & 0 deletions clang/test/PCH/external-defs.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// REQUIRES: x86-registered-target
// Test with pch.
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t.pch %S/external-defs.h
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -include-pch %t.pch -emit-llvm -o %t %s
Expand Down
1 change: 1 addition & 0 deletions clang/test/PCH/floating-literal.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -triple mips64-none-linux-gnu -emit-pch -o %t %s
// REQUIRES: mips-registered-target
// RUN: %clang_cc1 -x ast -ast-print %t | FileCheck %s

// Make sure the semantics of FloatingLiterals are stored correctly in
Expand Down
1 change: 1 addition & 0 deletions clang/test/PCH/local_static.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// REQUIRES: x86-registered-target
// Test this without PCH.
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9.0 -include %S/local_static.h -fsyntax-only %s -emit-llvm -o %t.no_pch.ll %s
// RUN: FileCheck --input-file %t.no_pch.ll %s
Expand Down
1 change: 1 addition & 0 deletions clang/test/PCH/pchpch.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-pch -o %t1 %S/pchpch1.h
// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-pch -o %t2 %S/pchpch2.h -include-pch %t1
// RUN: %clang_cc1 -triple i386-unknown-unknown -fsyntax-only %s -include-pch %t2
// REQUIRES: x86-registered-target

// The purpose of this test is to make sure that a PCH created while including
// an existing PCH can be loaded.
1 change: 1 addition & 0 deletions clang/test/PCH/reloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// RUN: %clang -target x86_64-apple-darwin10 -fsyntax-only \
// RUN: -include-pch %t -isysroot %S/libroot %s -Xclang -verify
// RUN: not %clang -target x86_64-apple-darwin10 -include-pch %t %s
// REQUIRES: x86-registered-target

#include <reloc.h>

Expand Down
1 change: 1 addition & 0 deletions clang/test/PCH/subscripting-literals.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o %t.nopch.ll %s
// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-pch -o %t.pch %s
// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o %t.pch.ll %s -include-pch %t.pch
// REQUIRES: x86-registered-target
// RUN: diff %t.nopch.ll %t.pch.ll

#ifndef HEADER
Expand Down
1 change: 1 addition & 0 deletions clang/test/PCH/target-options.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// RUN: %clang_cc1 -triple=x86_64-apple-darwin9 -emit-pch -o %t.pch %S/target-options.h
// RUN: not %clang_cc1 -triple=x86_64-unknown-freebsd7.0 -include-pch %t.pch %s -emit-llvm -o - > %t.err 2>&1
// RUN: FileCheck %s < %t.err
// REQUIRES: x86-registered-target

// CHECK: for the target
1 change: 1 addition & 0 deletions clang/test/PCH/tentative-defs.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Test with pch.
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-pch -o %t.pch %S/tentative-defs.h
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -include-pch %t.pch -verify -emit-llvm -o %t %s
// REQUIRES: x86-registered-target

// RUN: grep "@variable = common global i32 0" %t | count 1
// RUN: grep "@incomplete_array = common global .*1 x i32" %t | count 1
Expand Down
2 changes: 1 addition & 1 deletion clang/test/PCH/thread-local.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -pedantic-errors -std=c++11 -triple x86_64-linux-gnu -emit-pch %s -o %t
// RUN: %clang_cc1 -pedantic-errors -std=c++11 -triple x86_64-linux-gnu -include-pch %t -verify %s

// REQUIRES: x86-registered-target
#ifndef HEADER_INCLUDED

#define HEADER_INCLUDED
Expand Down
1 change: 1 addition & 0 deletions clang/test/PCH/va_arg.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Test this without pch.
// RUN: %clang_cc1 -triple=x86_64-unknown-freebsd7.0 -include %S/va_arg.h %s -emit-llvm -o -
// REQUIRES: x86-registered-target

// Test with pch.
// RUN: %clang_cc1 -triple=x86_64-unknown-freebsd7.0 -emit-pch -o %t %S/va_arg.h
Expand Down
1 change: 1 addition & 0 deletions clang/test/PCH/va_arg.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Test this without pch.
// RUN: %clang_cc1 -triple=x86_64-unknown-freebsd7.0 -include %S/Inputs/va_arg.h %s -emit-llvm -o -
// REQUIRES: x86-registered-target

// Test with pch.
// RUN: %clang_cc1 -triple=x86_64-unknown-freebsd7.0 -emit-pch -x c++-header -o %t %S/Inputs/va_arg.h
Expand Down
2 changes: 2 additions & 0 deletions clang/tools/clang-check/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set(LLVM_LINK_COMPONENTS
${LLVM_TARGETS_TO_BUILD}
Option
Support
)
Expand All @@ -11,6 +12,7 @@ target_link_libraries(clang-check
clangAST
clangBasic
clangDriver
clangCodeGen
clangFrontend
clangRewriteFrontend
clangStaticAnalyzerFrontend
Expand Down
4 changes: 3 additions & 1 deletion clang/tools/clang-check/ClangCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
//===----------------------------------------------------------------------===//

#include "clang/AST/ASTConsumer.h"
#include "clang/CodeGen/ObjectFilePCHContainerOperations.h"
#include "clang/Driver/Options.h"
#include "clang/Frontend/ASTConsumers.h"
#include "clang/Frontend/CompilerInstance.h"
Expand Down Expand Up @@ -151,7 +152,8 @@ int main(int argc, const char **argv) {
llvm::sys::PrintStackTraceOnErrorSignal();
CommonOptionsParser OptionsParser(argc, argv, ClangCheckCategory);
ClangTool Tool(OptionsParser.getCompilations(),
OptionsParser.getSourcePathList());
OptionsParser.getSourcePathList(),
std::make_shared<clang::ObjectFilePCHContainerOperations>());

// Clear adjusters because -fsyntax-only is inserted by the default chain.
Tool.clearArgumentsAdjusters();
Expand Down
9 changes: 6 additions & 3 deletions clang/tools/clang-check/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ TOOLNAME = clang-check
TOOL_NO_EXPORTS = 1

include $(CLANG_LEVEL)/../../Makefile.config
LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc option
USEDLIBS = clangFrontend.a clangSerialization.a clangDriver.a \
LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader ipo objcarcopts \
instrumentation bitwriter support mc option
USEDLIBS = clangFrontend.a clangCodeGen.a clangIndex.a \
clangSerialization.a clangDriver.a \
clangTooling.a clangParse.a clangSema.a \
clangStaticAnalyzerFrontend.a clangStaticAnalyzerCheckers.a \
clangStaticAnalyzerCore.a clangAnalysis.a clangRewriteFrontend.a \
clangRewrite.a clangEdit.a clangAST.a clangLex.a clangBasic.a
clangRewrite.a clangEdit.a clangAST.a clangLex.a \
clangBasic.a

include $(CLANG_LEVEL)/Makefile
6 changes: 3 additions & 3 deletions clang/tools/driver/cc1_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//===----------------------------------------------------------------------===//

#include "llvm/Option/Arg.h"
#include "clang/Frontend/PCHContainerOperations.h"
#include "clang/CodeGen/ObjectFilePCHContainerOperations.h"
#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Driver/Options.h"
#include "clang/Frontend/CompilerInstance.h"
Expand Down Expand Up @@ -65,8 +65,8 @@ void initializePollyPasses(llvm::PassRegistry &Registry);
#endif

int cc1_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
std::unique_ptr<CompilerInstance> Clang(
new CompilerInstance(std::make_shared<RawPCHContainerOperations>()));
std::unique_ptr<CompilerInstance> Clang(new CompilerInstance(
std::make_shared<ObjectFilePCHContainerOperations>()));
IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());

// Initialize targets first, so that --version shows registered targets.
Expand Down
4 changes: 3 additions & 1 deletion clang/tools/libclang/CIndex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "clang/Basic/DiagnosticIDs.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Basic/Version.h"
#include "clang/CodeGen/ObjectFilePCHContainerOperations.h"
#include "clang/Frontend/ASTUnit.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendDiagnostic.h"
Expand Down Expand Up @@ -2876,7 +2877,8 @@ CXIndex clang_createIndex(int excludeDeclarationsFromPCH,
// registered once.
(void)*RegisterFatalErrorHandlerOnce;

CIndexer *CIdxr = new CIndexer();
CIndexer *CIdxr =
new CIndexer(std::make_shared<ObjectFilePCHContainerOperations>());
if (excludeDeclarationsFromPCH)
CIdxr->setOnlyLocalDecls();
if (displayDiagnostics)
Expand Down
5 changes: 5 additions & 0 deletions clang/tools/libclang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,14 @@ set(SOURCES
../../include/clang-c/Index.h
)

set( LLVM_LINK_COMPONENTS
${LLVM_TARGETS_TO_BUILD}
)

set(LIBS
clangAST
clangBasic
clangCodeGen
clangFrontend
clangIndex
clangLex
Expand Down
8 changes: 5 additions & 3 deletions clang/tools/libclang/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,21 @@ LINK_LIBS_IN_SHARED = 1
SHARED_LIBRARY = 1

include $(CLANG_LEVEL)/../../Makefile.config
LINK_COMPONENTS := AsmParser BitReader Core MC MCParser Option Support
LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter core \
instrumentation ipo mc mcparser objcarcopts option support \
object
USEDLIBS = clangIndex.a clangARCMigrate.a \
clangRewriteFrontend.a \
clangFormat.a \
clangTooling.a clangToolingCore.a \
clangFrontend.a clangDriver.a \
clangFrontend.a clangCodeGen.a clangDriver.a \
clangSerialization.a \
clangParse.a clangSema.a \
clangStaticAnalyzerCheckers.a clangStaticAnalyzerCore.a \
clangRewrite.a \
clangAnalysis.a clangEdit.a \
clangASTMatchers.a \
clangAST.a clangLex.a clangBasic.a \
clangAST.a clangLex.a clangBasic.a

include $(CLANG_LEVEL)/Makefile

Expand Down