aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2013-04-16 22:48:20 +0000
committerJohn McCall <rjmccall@apple.com>2013-04-16 22:48:20 +0000
commit3abae0995b5d4faa3d8cfb1f06118d71a60c7dab (patch)
treeffc61638099b0ddee57d48abf8ad361585f53d98
parent64aa4b3ec7e62288e2e66c1935487ece995ca94b (diff)
Don't propagate around TargetOptions in IR-gen; we don't use it.
Patch by Stephen Lin! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179639 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CodeGenModule.cpp4
-rw-r--r--lib/CodeGen/CodeGenModule.h5
-rw-r--r--lib/CodeGen/ModuleBuilder.cpp14
3 files changed, 9 insertions, 14 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 6c2578f336..42be779afb 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -35,7 +35,6 @@
#include "clang/Basic/Module.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetInfo.h"
-#include "clang/Basic/TargetOptions.h"
#include "clang/Frontend/CodeGenOptions.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/Triple.h"
@@ -70,8 +69,7 @@ static CGCXXABI &createCXXABI(CodeGenModule &CGM) {
CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
- const TargetOptions &TO, llvm::Module &M,
- const llvm::DataLayout &TD,
+ llvm::Module &M, const llvm::DataLayout &TD,
DiagnosticsEngine &diags)
: Context(C), LangOpts(C.getLangOpts()), CodeGenOpts(CGO), TheModule(M),
Diags(diags), TheDataLayout(TD), Target(C.getTargetInfo()),
diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h
index c1f951614a..1a803f38c0 100644
--- a/lib/CodeGen/CodeGenModule.h
+++ b/lib/CodeGen/CodeGenModule.h
@@ -67,7 +67,6 @@ namespace clang {
class VarDecl;
class LangOptions;
class CodeGenOptions;
- class TargetOptions;
class DiagnosticsEngine;
class AnnotateAttr;
class CXXDestructorDecl;
@@ -408,8 +407,8 @@ class CodeGenModule : public CodeGenTypeCache {
/// @}
public:
CodeGenModule(ASTContext &C, const CodeGenOptions &CodeGenOpts,
- const TargetOptions &TargetOpts, llvm::Module &M,
- const llvm::DataLayout &TD, DiagnosticsEngine &Diags);
+ llvm::Module &M, const llvm::DataLayout &TD,
+ DiagnosticsEngine &Diags);
~CodeGenModule();
diff --git a/lib/CodeGen/ModuleBuilder.cpp b/lib/CodeGen/ModuleBuilder.cpp
index d6e5f0673f..69e5b32304 100644
--- a/lib/CodeGen/ModuleBuilder.cpp
+++ b/lib/CodeGen/ModuleBuilder.cpp
@@ -31,15 +31,13 @@ namespace {
OwningPtr<const llvm::DataLayout> TD;
ASTContext *Ctx;
const CodeGenOptions CodeGenOpts; // Intentionally copied in.
- const TargetOptions TargetOpts; // Intentionally copied in.
protected:
OwningPtr<llvm::Module> M;
OwningPtr<CodeGen::CodeGenModule> Builder;
public:
CodeGeneratorImpl(DiagnosticsEngine &diags, const std::string& ModuleName,
- const CodeGenOptions &CGO, const TargetOptions &TO,
- llvm::LLVMContext& C)
- : Diags(diags), CodeGenOpts(CGO), TargetOpts(TO),
+ const CodeGenOptions &CGO, llvm::LLVMContext& C)
+ : Diags(diags), CodeGenOpts(CGO),
M(new llvm::Module(ModuleName, C)) {}
virtual ~CodeGeneratorImpl() {}
@@ -58,8 +56,8 @@ namespace {
M->setTargetTriple(Ctx->getTargetInfo().getTriple().getTriple());
M->setDataLayout(Ctx->getTargetInfo().getTargetDescription());
TD.reset(new llvm::DataLayout(Ctx->getTargetInfo().getTargetDescription()));
- Builder.reset(new CodeGen::CodeGenModule(Context, CodeGenOpts, TargetOpts,
- *M, *TD, Diags));
+ Builder.reset(new CodeGen::CodeGenModule(Context, CodeGenOpts, *M, *TD,
+ Diags));
}
virtual void HandleCXXStaticMemberVarInstantiation(VarDecl *VD) {
@@ -125,7 +123,7 @@ void CodeGenerator::anchor() { }
CodeGenerator *clang::CreateLLVMCodeGen(DiagnosticsEngine &Diags,
const std::string& ModuleName,
const CodeGenOptions &CGO,
- const TargetOptions &TO,
+ const TargetOptions &/*TO*/,
llvm::LLVMContext& C) {
- return new CodeGeneratorImpl(Diags, ModuleName, CGO, TO, C);
+ return new CodeGeneratorImpl(Diags, ModuleName, CGO, C);
}