summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp28
1 files changed, 17 insertions, 11 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 2dd5414..b905bd2 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -74,16 +74,19 @@ static CGCXXABI *createCXXABI(CodeGenModule &CGM) {
llvm_unreachable("invalid C++ ABI kind");
}
-CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
- llvm::Module &M, const llvm::DataLayout &TD,
+CodeGenModule::CodeGenModule(ASTContext &C, const HeaderSearchOptions &HSO,
+ const PreprocessorOptions &PPO,
+ const CodeGenOptions &CGO, llvm::Module &M,
+ const llvm::DataLayout &TD,
DiagnosticsEngine &diags,
CoverageSourceInfo *CoverageInfo)
- : Context(C), LangOpts(C.getLangOpts()), CodeGenOpts(CGO), TheModule(M),
- Diags(diags), TheDataLayout(TD), Target(C.getTargetInfo()),
- ABI(createCXXABI(*this)), VMContext(M.getContext()), TBAA(nullptr),
- TheTargetCodeGenInfo(nullptr), Types(*this), VTables(*this),
- ObjCRuntime(nullptr), OpenCLRuntime(nullptr), OpenMPRuntime(nullptr),
- CUDARuntime(nullptr), DebugInfo(nullptr), ARCData(nullptr),
+ : Context(C), LangOpts(C.getLangOpts()), HeaderSearchOpts(HSO),
+ PreprocessorOpts(PPO), CodeGenOpts(CGO), TheModule(M), Diags(diags),
+ TheDataLayout(TD), Target(C.getTargetInfo()), ABI(createCXXABI(*this)),
+ VMContext(M.getContext()), TBAA(nullptr), TheTargetCodeGenInfo(nullptr),
+ Types(*this), VTables(*this), ObjCRuntime(nullptr),
+ OpenCLRuntime(nullptr), OpenMPRuntime(nullptr), CUDARuntime(nullptr),
+ DebugInfo(nullptr), ARCData(nullptr),
NoObjCARCExceptionsMetadata(nullptr), RRData(nullptr), PGOReader(nullptr),
CFConstantStringClassRef(nullptr), ConstantStringClassRef(nullptr),
NSConstantStringType(nullptr), NSConcreteGlobalBlock(nullptr),
@@ -145,8 +148,9 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
llvm::IndexedInstrProfReader::create(CodeGenOpts.InstrProfileInput);
if (std::error_code EC = ReaderOrErr.getError()) {
unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error,
- "Could not read profile: %0");
- getDiags().Report(DiagID) << EC.message();
+ "Could not read profile %0: %1");
+ getDiags().Report(DiagID) << CodeGenOpts.InstrProfileInput
+ << EC.message();
} else
PGOReader = std::move(ReaderOrErr.get());
}
@@ -1424,7 +1428,7 @@ namespace {
return false;
}
unsigned BuiltinID = FD->getBuiltinID();
- if (!BuiltinID)
+ if (!BuiltinID || !BI.isLibFunction(BuiltinID))
return true;
StringRef BuiltinName = BI.GetName(BuiltinID);
if (BuiltinName.startswith("__builtin_") &&
@@ -3358,6 +3362,8 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) {
Owner->getTopLevelModule()->Name == getLangOpts().CurrentModule)
break;
}
+ if (CGDebugInfo *DI = getModuleDebugInfo())
+ DI->EmitImportDecl(*Import);
ImportedModules.insert(Import->getImportedModule());
break;
OpenPOWER on IntegriCloud