summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenAction.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2017-01-05 16:02:32 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2017-01-05 16:02:32 +0000
commit888e289ed7aeb5438340da913bfdfb865a67f4cd (patch)
treef49b6603e54b58c8b1c0ba28bb54c458dd9388d1 /clang/lib/CodeGen/CodeGenAction.cpp
parentbca02f9e2014e7e73ac442b99cf9e9e019a4ee91 (diff)
downloadbcm5719-llvm-888e289ed7aeb5438340da913bfdfb865a67f4cd.tar.gz
bcm5719-llvm-888e289ed7aeb5438340da913bfdfb865a67f4cd.zip
CodeGen: plumb header search down to the IAS
inline assembly may use the `.include` directive to include other content into the file. Without the integrated assembler, the `-I` group gets passed to the assembler. Emulate this by collecting the header search paths and passing them to the IAS. Resolves PR24811! llvm-svn: 291123
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index 1e17918df4a..5f74141d75b 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -44,6 +44,7 @@ namespace clang {
virtual void anchor();
DiagnosticsEngine &Diags;
BackendAction Action;
+ const HeaderSearchOptions &HeaderSearchOpts;
const CodeGenOptions &CodeGenOpts;
const TargetOptions &TargetOpts;
const LangOptions &LangOpts;
@@ -77,8 +78,8 @@ namespace clang {
const SmallVectorImpl<std::pair<unsigned, llvm::Module *>> &LinkModules,
std::unique_ptr<raw_pwrite_stream> OS, LLVMContext &C,
CoverageSourceInfo *CoverageInfo = nullptr)
- : Diags(Diags), Action(Action), CodeGenOpts(CodeGenOpts),
- TargetOpts(TargetOpts), LangOpts(LangOpts),
+ : Diags(Diags), Action(Action), HeaderSearchOpts(HeaderSearchOpts),
+ CodeGenOpts(CodeGenOpts), TargetOpts(TargetOpts), LangOpts(LangOpts),
AsmOutStream(std::move(OS)), Context(nullptr),
LLVMIRGeneration("irgen", "LLVM IR Generation Time"),
LLVMIRGenerationRefCount(0),
@@ -225,8 +226,8 @@ namespace clang {
EmbedBitcode(getModule(), CodeGenOpts, llvm::MemoryBufferRef());
- EmitBackendOutput(Diags, CodeGenOpts, TargetOpts, LangOpts,
- C.getTargetInfo().getDataLayout(),
+ EmitBackendOutput(Diags, HeaderSearchOpts, CodeGenOpts, TargetOpts,
+ LangOpts, C.getTargetInfo().getDataLayout(),
getModule(), Action, std::move(AsmOutStream));
Ctx.setInlineAsmDiagnosticHandler(OldHandler, OldContext);
@@ -898,9 +899,10 @@ void CodeGenAction::ExecuteAction() {
Ctx.setInlineAsmDiagnosticHandler(BitcodeInlineAsmDiagHandler,
&CI.getDiagnostics());
- EmitBackendOutput(CI.getDiagnostics(), CI.getCodeGenOpts(), TargetOpts,
- CI.getLangOpts(), CI.getTarget().getDataLayout(),
- TheModule.get(), BA, std::move(OS));
+ EmitBackendOutput(CI.getDiagnostics(), CI.getHeaderSearchOpts(),
+ CI.getCodeGenOpts(), TargetOpts, CI.getLangOpts(),
+ CI.getTarget().getDataLayout(), TheModule.get(), BA,
+ std::move(OS));
return;
}
OpenPOWER on IntegriCloud