[cfe-commits] r90119 - in /cfe/trunk: lib/CodeGen/CodeGenModule.cpp lib/Driver/CC1Options.cpp tools/clang-cc/Options.cpp
Daniel Dunbar
daniel at zuster.org
Mon Nov 30 00:40:38 PST 2009
Author: ddunbar
Date: Mon Nov 30 02:40:34 2009
New Revision: 90119
URL: http://llvm.org/viewvc/llvm-project?rev=90119&view=rev
Log:
Don't try to generate common globals for C++ files, instead of depending on the FE to set NoCommon, and simplify CodeGenOptions initialization.
Modified:
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
cfe/trunk/lib/Driver/CC1Options.cpp
cfe/trunk/tools/clang-cc/Options.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=90119&r1=90118&r2=90119&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Mon Nov 30 02:40:34 2009
@@ -973,7 +973,7 @@
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);
Modified: cfe/trunk/lib/Driver/CC1Options.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/CC1Options.cpp?rev=90119&r1=90118&r2=90119&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/CC1Options.cpp (original)
+++ cfe/trunk/lib/Driver/CC1Options.cpp Mon Nov 30 02:40:34 2009
@@ -190,11 +190,6 @@
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;
Modified: cfe/trunk/tools/clang-cc/Options.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/Options.cpp?rev=90119&r1=90118&r2=90119&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/Options.cpp (original)
+++ cfe/trunk/tools/clang-cc/Options.cpp Mon Nov 30 02:40:34 2009
@@ -826,10 +826,6 @@
Opts.UnwindTables = MUnwindTables;
Opts.RelocationModel = MRelocationModel;
- // FIXME: Eliminate this dependency?
- if (Lang.CPlusPlus)
- Opts.NoCommon = 1;
-
#ifdef NDEBUG
Opts.VerifyModule = 0;
#endif
More information about the cfe-commits
mailing list