]> granicus.if.org Git - clang/commitdiff
Don't try to generate common globals for C++ files, instead of depending on the FE...
authorDaniel Dunbar <daniel@zuster.org>
Mon, 30 Nov 2009 08:40:34 +0000 (08:40 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 30 Nov 2009 08:40:34 +0000 (08:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90119 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenModule.cpp
lib/Driver/CC1Options.cpp
tools/clang-cc/Options.cpp

index bbad876575d150417e74425739eaa8fa8273beb3..a14733aba02e69e4e416dd8ac2d48202fa48eb08 100644 (file)
@@ -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);
index f2a8492f0a8b2584ccc4a85ac2cc95574e9f2c2c..9a2b5e622181798f3e400b6149332a582d3b2928 100644 (file)
@@ -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;
index ed491d8e977c9f427d9543bd0e990e7128ca7bcb..f1a90b7349c3540a12d55b8835bbd92cb038f3b8 100644 (file)
@@ -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