Don't try to generate common globals for C++ files, instead of depending on the FE to set NoCommon, and simplify CodeGenOptions initialization.
llvm-svn: 90119
This commit is contained in:
@@ -973,7 +973,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
|
|||||||
GV->setLinkage(llvm::GlobalVariable::WeakAnyLinkage);
|
GV->setLinkage(llvm::GlobalVariable::WeakAnyLinkage);
|
||||||
} else if (Linkage == GVA_TemplateInstantiation)
|
} else if (Linkage == GVA_TemplateInstantiation)
|
||||||
GV->setLinkage(llvm::GlobalVariable::WeakAnyLinkage);
|
GV->setLinkage(llvm::GlobalVariable::WeakAnyLinkage);
|
||||||
else if (!CodeGenOpts.NoCommon &&
|
else if (!getLangOptions().CPlusPlus && !CodeGenOpts.NoCommon &&
|
||||||
!D->hasExternalStorage() && !D->getInit() &&
|
!D->hasExternalStorage() && !D->getInit() &&
|
||||||
!D->getAttr<SectionAttr>()) {
|
!D->getAttr<SectionAttr>()) {
|
||||||
GV->setLinkage(llvm::GlobalVariable::CommonLinkage);
|
GV->setLinkage(llvm::GlobalVariable::CommonLinkage);
|
||||||
|
|||||||
@@ -190,11 +190,6 @@ static void ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
|
|||||||
|
|
||||||
Opts.MainFileName = getLastArgValue(Args, OPT_main_file_name);
|
Opts.MainFileName = getLastArgValue(Args, OPT_main_file_name);
|
||||||
|
|
||||||
// FIXME: Implement!
|
|
||||||
// FIXME: Eliminate this dependency?
|
|
||||||
// if (Lang.CPlusPlus)
|
|
||||||
// Opts.NoCommon = 1;
|
|
||||||
|
|
||||||
// FIXME: Put elsewhere?
|
// FIXME: Put elsewhere?
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
Opts.VerifyModule = 0;
|
Opts.VerifyModule = 0;
|
||||||
|
|||||||
@@ -826,10 +826,6 @@ void clang::InitializeCodeGenOptions(CodeGenOptions &Opts,
|
|||||||
Opts.UnwindTables = MUnwindTables;
|
Opts.UnwindTables = MUnwindTables;
|
||||||
Opts.RelocationModel = MRelocationModel;
|
Opts.RelocationModel = MRelocationModel;
|
||||||
|
|
||||||
// FIXME: Eliminate this dependency?
|
|
||||||
if (Lang.CPlusPlus)
|
|
||||||
Opts.NoCommon = 1;
|
|
||||||
|
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
Opts.VerifyModule = 0;
|
Opts.VerifyModule = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user