Commit Graph

6 Commits

Author SHA1 Message Date
Saleem Abdulrasool 729b7d357d Lex: reduce buffer size, add a test
Reduce the stack usage as hopefully include paths are usually not too long.  Add
a test case for the path normalisation behaviour.

llvm-svn: 203632
2014-03-12 02:26:08 +00:00
Ismail Pazarbasi 8d0f2f3ae3 Relax header guard mismatch warning with edit distance heuristic.
If the edit distance between the two macros is more than 50%, DefinedMacro may not be header guard or can be header guard of another header file or it might be defining something completely different set by the build environment.

llvm-svn: 192547
2013-10-12 23:17:37 +00:00
Richard Smith 089ee1554c PR16339: Don't produce a diagnostic pointing at the whitespace between a '#if'
and a '!defined(X)' if we find a broken header guard. This is suboptimal; we
should point the diagnostic at the 'X' token not the 'if' token, but it fixes
the crash.

llvm-svn: 184054
2013-06-16 05:05:39 +00:00
Richard Trieu 33a4b3db0d Introducing -Wheader-guard, a warning that checks header guards actually work
properly.  This warning checks that the #ifndef and #define directives at
the beginning of a header refer to the same macro name.  Includes a fix-it
hint to correct the header guard.

llvm-svn: 183867
2013-06-12 21:20:57 +00:00
Daniel Dunbar cb08212fd5 tests: Use FileCheck instead of external input; I think this test was failing on
Win32 because of line ending differences.

llvm-svn: 109029
2010-07-21 19:40:01 +00:00
Douglas Gregor af82e3510b Introduce a new lexer function to compute the "preamble" of a file,
which is the part of the file that contains all of the initial
comments, includes, and preprocessor directives that occur before any
of the actual code. Added a new -print-preamble cc1 action that is
only used for testing.

llvm-svn: 108913
2010-07-20 20:18:03 +00:00