[cfe-commits] r86013 - in /cfe/trunk: lib/Driver/Tools.cpp tools/clang-cc/clang-cc.cpp
Daniel Dunbar
daniel at zuster.org
Tue Nov 3 22:24:47 PST 2009
Author: ddunbar
Date: Wed Nov 4 00:24:47 2009
New Revision: 86013
URL: http://llvm.org/viewvc/llvm-project?rev=86013&view=rev
Log:
Move logic for selection -fmessage-length= to driver.
Modified:
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/tools/clang-cc/clang-cc.cpp
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=86013&r1=86012&r2=86013&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Nov 4 00:24:47 2009
@@ -26,6 +26,7 @@
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/System/Process.h"
#include "InputInfo.h"
#include "ToolChains.h"
@@ -839,13 +840,23 @@
CmdArgs.push_back(A->getValue(Args));
}
+ // Pass -fmessage-length=.
+ if (Arg *A = Args.getLastArg(options::OPT_fmessage_length_EQ)) {
+ A->render(Args, CmdArgs);
+ } else {
+ // If -fmessage-length=N was not specified, determine whether this is a
+ // terminal and, if so, implicitly define -fmessage-length appropriately.
+ unsigned N = llvm::sys::Process::StandardErrColumns();
+ CmdArgs.push_back("-fmessage-length");
+ CmdArgs.push_back(Args.MakeArgString(llvm::Twine(N)));
+ }
+
// Forward -f options which we can pass directly.
Args.AddLastArg(CmdArgs, options::OPT_femit_all_decls);
Args.AddLastArg(CmdArgs, options::OPT_ffreestanding);
Args.AddLastArg(CmdArgs, options::OPT_fheinous_gnu_extensions);
Args.AddLastArg(CmdArgs, options::OPT_fgnu_runtime);
Args.AddLastArg(CmdArgs, options::OPT_flax_vector_conversions);
- Args.AddLastArg(CmdArgs, options::OPT_fmessage_length_EQ);
Args.AddLastArg(CmdArgs, options::OPT_fms_extensions);
Args.AddLastArg(CmdArgs, options::OPT_fnext_runtime);
Args.AddLastArg(CmdArgs, options::OPT_fno_caret_diagnostics);
Modified: cfe/trunk/tools/clang-cc/clang-cc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-cc/clang-cc.cpp?rev=86013&r1=86012&r2=86013&view=diff
==============================================================================
--- cfe/trunk/tools/clang-cc/clang-cc.cpp (original)
+++ cfe/trunk/tools/clang-cc/clang-cc.cpp Wed Nov 4 00:24:47 2009
@@ -2153,12 +2153,6 @@
if (InputFilenames.empty())
InputFilenames.push_back("-");
- // If -fmessage-length=N was not specified, determine whether this
- // is a terminal and, if so, implicitly define -fmessage-length
- // appropriately.
- if (MessageLength.getNumOccurrences() == 0)
- MessageLength.setValue(llvm::sys::Process::StandardErrColumns());
-
// Initialize the diagnostic options.
DiagOpts.ShowColumn = !NoShowColumn;
DiagOpts.ShowLocation = !NoShowLocation;
More information about the cfe-commits
mailing list