forked from OSchip/llvm-project
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:
parent
8e70505692
commit
2c11cd156e
|
@ -973,7 +973,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
|
|||
GV->setLinkage(llvm::GlobalVariable::WeakAnyLinkage);
|
||||
} else if (Linkage == GVA_TemplateInstantiation)
|
||||
GV->setLinkage(llvm::GlobalVariable::WeakAnyLinkage);
|
||||
else if (!CodeGenOpts.NoCommon &&
|
||||
else if (!getLangOptions().CPlusPlus && !CodeGenOpts.NoCommon &&
|
||||
!D->hasExternalStorage() && !D->getInit() &&
|
||||
!D->getAttr<SectionAttr>()) {
|
||||
GV->setLinkage(llvm::GlobalVariable::CommonLinkage);
|
||||
|
|
|
@ -190,11 +190,6 @@ static void ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
|
|||
|
||||
Opts.MainFileName = getLastArgValue(Args, OPT_main_file_name);
|
||||
|
||||
// FIXME: Implement!
|
||||
// FIXME: Eliminate this dependency?
|
||||
// if (Lang.CPlusPlus)
|
||||
// Opts.NoCommon = 1;
|
||||
|
||||
// FIXME: Put elsewhere?
|
||||
#ifdef NDEBUG
|
||||
Opts.VerifyModule = 0;
|
||||
|
|
|
@ -826,10 +826,6 @@ void clang::InitializeCodeGenOptions(CodeGenOptions &Opts,
|
|||
Opts.UnwindTables = MUnwindTables;
|
||||
Opts.RelocationModel = MRelocationModel;
|
||||
|
||||
// FIXME: Eliminate this dependency?
|
||||
if (Lang.CPlusPlus)
|
||||
Opts.NoCommon = 1;
|
||||
|
||||
#ifdef NDEBUG
|
||||
Opts.VerifyModule = 0;
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue