summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-04-07 05:41:11 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-04-07 05:41:11 +0000
commit724275ba5fb137eedbb1930e5bad493acea1b4ce (patch)
treec4685b16122f59ceaccb3b2fb4a780123a051cd1 /clang/lib/Frontend
parent979e9756ecbcba1a1b4743048cb1193fb799bd53 (diff)
downloadbcm5719-llvm-724275ba5fb137eedbb1930e5bad493acea1b4ce.tar.gz
bcm5719-llvm-724275ba5fb137eedbb1930e5bad493acea1b4ce.zip
Basic: thread CodeGenOptions into TargetInfo
This threads CodeGenOptions into the TargetInfo hierarchy. This is motivated by ARM which can change some target information based on the EABI selected (-meabi). Similar options exist for other platforms (e.g. MIPS) and thus is generally useful. NFC. llvm-svn: 265640
Diffstat (limited to 'clang/lib/Frontend')
-rw-r--r--clang/lib/Frontend/ASTUnit.cpp12
-rw-r--r--clang/lib/Frontend/ChainedIncludesSource.cpp3
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp6
3 files changed, 14 insertions, 7 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 61e80d5d729..c7f63652562 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -1058,7 +1058,8 @@ bool ASTUnit::Parse(std::shared_ptr<PCHContainerOperations> PCHContainerOps,
// Create the target instance.
Clang->setTarget(TargetInfo::CreateTargetInfo(
- Clang->getDiagnostics(), Clang->getInvocation().TargetOpts));
+ Clang->getDiagnostics(), Clang->getInvocation().TargetOpts,
+ Clang->getInvocation().getCodeGenOpts()));
if (!Clang->hasTarget())
return true;
@@ -1518,7 +1519,8 @@ ASTUnit::getMainBufferWithPrecompiledPreamble(
// Create the target instance.
Clang->setTarget(TargetInfo::CreateTargetInfo(
- Clang->getDiagnostics(), Clang->getInvocation().TargetOpts));
+ Clang->getDiagnostics(), Clang->getInvocation().TargetOpts,
+ Clang->getInvocation().getCodeGenOpts()));
if (!Clang->hasTarget()) {
llvm::sys::fs::remove(FrontendOpts.OutputFile);
Preamble.clear();
@@ -1781,7 +1783,8 @@ ASTUnit *ASTUnit::LoadFromCompilerInvocationAction(
// Create the target instance.
Clang->setTarget(TargetInfo::CreateTargetInfo(
- Clang->getDiagnostics(), Clang->getInvocation().TargetOpts));
+ Clang->getDiagnostics(), Clang->getInvocation().TargetOpts,
+ Clang->getInvocation().getCodeGenOpts()));
if (!Clang->hasTarget())
return nullptr;
@@ -2364,7 +2367,8 @@ void ASTUnit::CodeComplete(
// Create the target instance.
Clang->setTarget(TargetInfo::CreateTargetInfo(
- Clang->getDiagnostics(), Clang->getInvocation().TargetOpts));
+ Clang->getDiagnostics(), Clang->getInvocation().TargetOpts,
+ Clang->getInvocation().getCodeGenOpts()));
if (!Clang->hasTarget()) {
Clang->setInvocation(nullptr);
return;
diff --git a/clang/lib/Frontend/ChainedIncludesSource.cpp b/clang/lib/Frontend/ChainedIncludesSource.cpp
index 1c1081fbe08..3707976a21b 100644
--- a/clang/lib/Frontend/ChainedIncludesSource.cpp
+++ b/clang/lib/Frontend/ChainedIncludesSource.cpp
@@ -152,7 +152,8 @@ IntrusiveRefCntPtr<ExternalSemaSource> clang::createChainedIncludesSource(
Clang->setInvocation(CInvok.release());
Clang->setDiagnostics(Diags.get());
Clang->setTarget(TargetInfo::CreateTargetInfo(
- Clang->getDiagnostics(), Clang->getInvocation().TargetOpts));
+ Clang->getDiagnostics(), Clang->getInvocation().TargetOpts,
+ Clang->getCodeGenOpts()));
Clang->createFileManager();
Clang->createSourceManager(Clang->getFileManager());
Clang->createPreprocessor(TU_Prefix);
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index cac73befff0..76f2f9bc6b2 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -830,7 +830,8 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) {
// Create the target instance.
setTarget(TargetInfo::CreateTargetInfo(getDiagnostics(),
- getInvocation().TargetOpts));
+ getInvocation().TargetOpts,
+ getInvocation().getCodeGenOpts()));
if (!hasTarget())
return false;
@@ -838,7 +839,8 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) {
if (getLangOpts().CUDA && !getFrontendOpts().AuxTriple.empty()) {
std::shared_ptr<TargetOptions> TO(new TargetOptions);
TO->Triple = getFrontendOpts().AuxTriple;
- setAuxTarget(TargetInfo::CreateTargetInfo(getDiagnostics(), TO));
+ setAuxTarget(TargetInfo::CreateTargetInfo(getDiagnostics(), TO,
+ getInvocation().getCodeGenOpts()));
}
// Inform the target of the language options.
OpenPOWER on IntegriCloud