]> granicus.if.org Git - clang/commitdiff
Remove a dependency on Frontend headers in the Driver library. Also saves
authorChandler Carruth <chandlerc@gmail.com>
Thu, 6 May 2010 04:55:18 +0000 (04:55 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 6 May 2010 04:55:18 +0000 (04:55 +0000)
building and passing arguments to cc1 layer when setting values to their
defaults.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103162 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Frontend/DiagnosticOptions.h
lib/Driver/Tools.cpp

index 1da5eb4be5a80c2630e7aebadcc07d50ddb6713e..8eb66e57da923b24db2ec0bec5f5271c4b3e433c 100644 (file)
@@ -81,8 +81,8 @@ public:
     VerifyDiagnostics = 0;
     BinaryOutput = 0;
     ErrorLimit = 0;
-    TemplateBacktraceLimit = 0;
-    MacroBacktraceLimit = 0;
+    TemplateBacktraceLimit = DefaultTemplateBacktraceLimit;
+    MacroBacktraceLimit = DefaultMacroBacktraceLimit;
   }
 };
 
index 6335599721f691d00fbd7ed4183b5d14dfa025cc..4622e2d2ea645362029c11abd617912673801b2c 100644 (file)
@@ -21,7 +21,6 @@
 #include "clang/Driver/Options.h"
 #include "clang/Driver/ToolChain.h"
 #include "clang/Driver/Util.h"
-#include "clang/Frontend/DiagnosticOptions.h"
 
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/StringSwitch.h"
@@ -1083,20 +1082,16 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
   else
     CmdArgs.push_back("19");
 
-  CmdArgs.push_back("-fmacro-backtrace-limit");
-  if (Arg *A = Args.getLastArg(options::OPT_fmacro_backtrace_limit_EQ))
+  if (Arg *A = Args.getLastArg(options::OPT_fmacro_backtrace_limit_EQ)) {
+    CmdArgs.push_back("-fmacro-backtrace-limit");
     CmdArgs.push_back(A->getValue(Args));
-  else
-    CmdArgs.push_back(Args.MakeArgString(
-                   llvm::Twine(DiagnosticOptions::DefaultMacroBacktraceLimit)));
-                      
-  CmdArgs.push_back("-ftemplate-backtrace-limit");
-  if (Arg *A = Args.getLastArg(options::OPT_ftemplate_backtrace_limit_EQ))
+  }
+
+  if (Arg *A = Args.getLastArg(options::OPT_ftemplate_backtrace_limit_EQ)) {
+    CmdArgs.push_back("-ftemplate-backtrace-limit");
     CmdArgs.push_back(A->getValue(Args));
-  else
-    CmdArgs.push_back(Args.MakeArgString(
-                llvm::Twine(DiagnosticOptions::DefaultTemplateBacktraceLimit)));
-  
+  }
+
   // Pass -fmessage-length=.
   CmdArgs.push_back("-fmessage-length");
   if (Arg *A = Args.getLastArg(options::OPT_fmessage_length_EQ)) {