diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2009-11-12 17:24:48 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2009-11-12 17:24:48 +0000 |
commit | bc55fe26c6da0eebdbdf8046a6f230106c7a126f (patch) | |
tree | df0d44cdd0d40ab14d3c7574003527e1ab805ece /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 1025a4998b13d8c126b0bdee5aceba1958e1e2d0 (diff) | |
download | bcm5719-llvm-bc55fe26c6da0eebdbdf8046a6f230106c7a126f.tar.gz bcm5719-llvm-bc55fe26c6da0eebdbdf8046a6f230106c7a126f.zip |
Move CompileOptions -> CodeGenOptions, and sink it into the CodeGen library.
This resolves the layering violation where CodeGen depended on Frontend.
llvm-svn: 86998
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index ff193fb4897..45637af3ca4 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -17,7 +17,7 @@ #include "CGCall.h" #include "CGObjCRuntime.h" #include "Mangle.h" -#include "clang/Frontend/CompileOptions.h" +#include "clang/CodeGen/CodeGenOptions.h" #include "clang/AST/ASTContext.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/DeclCXX.h" @@ -35,11 +35,11 @@ using namespace clang; using namespace CodeGen; -CodeGenModule::CodeGenModule(ASTContext &C, const CompileOptions &compileOpts, +CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO, llvm::Module &M, const llvm::TargetData &TD, Diagnostic &diags) : BlockModule(C, M, TD, Types, *this), Context(C), - Features(C.getLangOptions()), CompileOpts(compileOpts), TheModule(M), + Features(C.getLangOptions()), CodeGenOpts(CGO), TheModule(M), TheTargetData(TD), Diags(diags), Types(C, M, TD), MangleCtx(C), VtableInfo(*this), Runtime(0), MemCpyFn(0), MemMoveFn(0), MemSetFn(0), CFConstantStringClassRef(0), @@ -55,7 +55,7 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CompileOptions &compileOpts, Runtime = CreateMacObjCRuntime(*this); // If debug info generation is enabled, create the CGDebugInfo object. - DebugInfo = CompileOpts.DebugInfo ? new CGDebugInfo(this) : 0; + DebugInfo = CodeGenOpts.DebugInfo ? new CGDebugInfo(this) : 0; } CodeGenModule::~CodeGenModule() { @@ -1082,7 +1082,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) { GV->setLinkage(llvm::GlobalVariable::WeakAnyLinkage); } else if (Linkage == GVA_TemplateInstantiation) GV->setLinkage(llvm::GlobalVariable::WeakAnyLinkage); - else if (!CompileOpts.NoCommon && + else if (!CodeGenOpts.NoCommon && !D->hasExternalStorage() && !D->getInit() && !D->getAttr<SectionAttr>()) { GV->setLinkage(llvm::GlobalVariable::CommonLinkage); |