summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-26 05:00:52 +0000
committerChris Lattner <sabre@nondot.org>2009-03-26 05:00:52 +0000
commit984fac5f5f0af8cf43f2feb025aceee70664e5c4 (patch)
treeb8630a33d15b8465e40a3aefa660b63444cfd26b /clang/lib/CodeGen/CodeGenModule.cpp
parent897b41dd77356c408eaa4a02f3d23b7da0a5ece7 (diff)
downloadbcm5719-llvm-984fac5f5f0af8cf43f2feb025aceee70664e5c4.tar.gz
bcm5719-llvm-984fac5f5f0af8cf43f2feb025aceee70664e5c4.zip
most of this is plumbing to get CompileOptions down into
CodeGenModule. Once there, add a new NoCommon option to it and implement -fno-common. llvm-svn: 67735
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 92af03ea89d..8a880516f66 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -11,12 +11,13 @@
//
//===----------------------------------------------------------------------===//
-#include "CGDebugInfo.h"
#include "CodeGenModule.h"
+#include "CGDebugInfo.h"
#include "CodeGenFunction.h"
#include "CGCall.h"
#include "CGObjCRuntime.h"
#include "Mangle.h"
+#include "clang/Frontend/CompileOptions.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclCXX.h"
@@ -31,10 +32,11 @@ using namespace clang;
using namespace CodeGen;
-CodeGenModule::CodeGenModule(ASTContext &C, const LangOptions &LO,
+CodeGenModule::CodeGenModule(ASTContext &C, const CompileOptions &compileOpts,
llvm::Module &M, const llvm::TargetData &TD,
- Diagnostic &diags, bool GenerateDebugInfo)
- : BlockModule(C, M, TD, Types, *this), Context(C), Features(LO), TheModule(M),
+ Diagnostic &diags)
+ : BlockModule(C, M, TD, Types, *this), Context(C),
+ Features(C.getLangOptions()), CompileOpts(compileOpts), TheModule(M),
TheTargetData(TD), Diags(diags), Types(C, M, TD), Runtime(0),
MemCpyFn(0), MemMoveFn(0), MemSetFn(0), CFConstantStringClassRef(0) {
@@ -48,7 +50,7 @@ CodeGenModule::CodeGenModule(ASTContext &C, const LangOptions &LO,
Runtime = CreateMacObjCRuntime(*this);
// If debug info generation is enabled, create the CGDebugInfo object.
- DebugInfo = GenerateDebugInfo ? new CGDebugInfo(this) : 0;
+ DebugInfo = CompileOpts.DebugInfo ? new CGDebugInfo(this) : 0;
}
CodeGenModule::~CodeGenModule() {
@@ -767,7 +769,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
case VarDecl::Register:
assert(0 && "Can't have auto or register globals");
case VarDecl::None:
- if (!D->getInit())
+ if (!D->getInit() && !CompileOpts.NoCommon)
GV->setLinkage(llvm::GlobalVariable::CommonLinkage);
else
GV->setLinkage(llvm::GlobalVariable::ExternalLinkage);
OpenPOWER on IntegriCloud