зеркало из https://github.com/microsoft/clang-1.git
Don't try to generate common globals for C++ files, instead of depending on the FE to set NoCommon, and simplify CodeGenOptions initialization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90119 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
b33fbaa5f1
Коммит
1bc5c03a7f
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче