aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-01 21:53:04 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-01 21:53:04 +0000
commitfffd93f38340d4d2ca7ee78a8c91c890b2ff3fa0 (patch)
treea33cebc2e3fc033a8d7d562f028c5e66e1bc5091 /lib/Driver/Tools.cpp
parentfc24e44bea29dcaabd9cf2c7663fe1c1286d90c1 (diff)
Implement -fmessage-length=N, which word-wraps diagnostics to N columns.
Also, put a line of whitespace between the diagnostic and the source code/caret line when the start of the actual source code text lines up (or nearly lines up) with the most recent line of the diagnostic. For example, here it's okay for the last line of the diagnostic to be (vertically) next to the source line, because there is horizontal whitespace to separate them: decl-expr-ambiguity.cpp:12:16: error: function-style cast to a builtin type can only take one argument typeof(int)(a,5)<<a; However, here is a case where we need the vertical separation (since there is no horizontal separation): message-length.c:10:46: warning: incompatible pointer types initializing 'void (int, float, char, float)', expected 'int (*)(int, float, short, float)' int (*fp1)(int, float, short, float) = f; This is part one of <rdar://problem/6711348>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70578 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r--lib/Driver/Tools.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 04661f81cf..83100248db 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -457,6 +457,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
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);