most of this is plumbing to get CompileOptions down into
CodeGenModule. Once there, add a new NoCommon option to
it and implement -fno-common.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67735 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/clang-cc/clang.cpp b/tools/clang-cc/clang.cpp
index e0a90a3..8beecd0 100644
--- a/tools/clang-cc/clang.cpp
+++ b/tools/clang-cc/clang.cpp
@@ -1235,6 +1235,10 @@
static llvm::cl::opt<bool>
OptSize("Os", llvm::cl::desc("Optimize for size"));
+static llvm::cl::opt<bool>
+NoCommon("fno-common",
+ llvm::cl::desc("Compile common globals like normal definitions"));
+
// It might be nice to add bounds to the CommandLine library directly.
struct OptLevelParser : public llvm::cl::parser<unsigned> {
bool parse(llvm::cl::Option &O, const char *ArgName,
@@ -1281,6 +1285,8 @@
Opts.Features.insert(Opts.Features.end(),
TargetFeatures.begin(), TargetFeatures.end());
+ Opts.NoCommon = NoCommon | LangOpts.CPlusPlus;
+
// Handle -ftime-report.
Opts.TimePasses = TimeReport;
}