Commit Graph

29 Commits

Author SHA1 Message Date
Chris Lattner fb24a3a4ec push some source location information down through the compiler,
into ContentCache::getBuffer.  This allows it to produce 
diagnostics on the broken #include line instead of without a 
location.

llvm-svn: 101939
2010-04-20 20:35:58 +00:00
Dan Gohman 6e8427e066 Remove this hard-coded buffer size. In some basic experiments preprocessing
large files, this doesn't seem significantly better than just letting
raw_ostream pick a buffer size.

This code predates raw-ostream's automatic buffer sizing; in fact, it
was introduced as part of the code which would eventually become
raw_ostream.

llvm-svn: 101473
2010-04-16 16:28:05 +00:00
Chris Lattner c745cec17c Improve line marker directive locations, patch by Jordy Rose
llvm-svn: 101226
2010-04-14 04:28:50 +00:00
Chris Lattner 0384e63501 make the token paste avoidance logic turn "..." into ".. ." instead of ". . ."
when avoiding paste.  Patch by David Peixotto!

llvm-svn: 101218
2010-04-14 03:57:19 +00:00
Chris Lattner 9d94f04f27 cache the PP's SourceManager.
llvm-svn: 101099
2010-04-13 00:06:42 +00:00
Chris Lattner 5dbefc6697 make the preprocessor listen to linemarker directives in -E mode,
PR6101.  This is based on a patch and testcase by Jordy Rose!

llvm-svn: 101097
2010-04-13 00:01:41 +00:00
Douglas Gregor 4ad3da2843 Entering the main source file in the preprocessor can fail if the
source file has been changed. Handle that failure more gracefully.

llvm-svn: 98727
2010-03-17 15:44:30 +00:00
Kovarththanan Rajaratnam ba2c65277a Use SmallString instead of SmallVector
llvm-svn: 98436
2010-03-13 10:17:05 +00:00
Kovarththanan Rajaratnam 752a124aeb Rename to addPPCallbacks since we're effectively adding a callback and maybe chaining it to an existing one
llvm-svn: 97913
2010-03-07 07:30:06 +00:00
Benjamin Kramer 718f722271 Revert 97324. Chris says this cleanup could hurt -E performance.
llvm-svn: 97331
2010-02-27 18:02:51 +00:00
Benjamin Kramer b14e0b637a Simplify code.
llvm-svn: 97324
2010-02-27 14:22:08 +00:00
Benjamin Kramer 0a1abd4088 Add an overload of Preprocessor::getSpelling which takes a SmallVector and
returns a StringRef. Use it to simplify some repetitive code.

llvm-svn: 97322
2010-02-27 13:44:12 +00:00
Benjamin Kramer fb5f40f959 Avoid an instantiation of std::sort.
llvm-svn: 93882
2010-01-19 17:42:20 +00:00
Chris Lattner 53d80e2c07 Neil points out that this could be simplified, do it.
llvm-svn: 90927
2009-12-09 02:08:14 +00:00
Chris Lattner 9dfed9fdb6 fix -dM with variadic macros, PR5699
llvm-svn: 90735
2009-12-07 01:58:34 +00:00
Chris Lattner 76b4445d6f some code cleanup.
llvm-svn: 90732
2009-12-07 01:42:56 +00:00
Steve Naroff 66aaa39568 Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=71473

llvm-svn: 90688
2009-12-06 01:02:14 +00:00
Daniel Dunbar 22bdabf05f Add PreprocessorOutputOptions to CompilerInvocation, and move initialization to
clang-cc/Options.cpp

llvm-svn: 86828
2009-11-11 10:07:44 +00:00
Daniel Dunbar 531f6c662b Add PreprocessorOutputOptions, for things like -dM, -C, -CC which control -E
mode.

llvm-svn: 86827
2009-11-11 10:07:22 +00:00
Ted Kremenek 66791d5dc5 Fix buffer overflow in PrintMacroDefinition() by inverting the check to see if the target buffer needs to be resized. Fixes <rdar://problem/7255377>.
llvm-svn: 85872
2009-11-03 06:18:05 +00:00
Daniel Dunbar 07d0785dbb PR5218: Replace IdentifierInfo::getName with StringRef version, now that clients
are updated.

llvm-svn: 84447
2009-10-18 21:17:35 +00:00
Daniel Dunbar 70e7eadd15 Move misc clients to IdentifierInfo StringRef API.
- strcmp -> ==
 - OS.write(II->getName() ...) -> OS << II->getNameStr()
 - Avoid std::string concatenation
 - Use getNameStr().str() when an std::string is really needed.

llvm-svn: 84437
2009-10-18 20:26:27 +00:00
Mike Stump 11289f4280 Remove tabs, and whitespace cleanups.
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
Chris Lattner a5e67757dc no really, add the lines :)
llvm-svn: 73367
2009-06-15 04:08:28 +00:00
Chris Lattner f2d49da9a8 Fix PR2741 by making our newline tracking be aware of newlines that
can occur in the middle of comment tokens.

llvm-svn: 73365
2009-06-15 01:25:23 +00:00
Eli Friedman fd80b2af16 PR4288: Make -dD (dump macros with preprocessed source) play nicely with
# line directives.

llvm-svn: 72724
2009-06-02 07:55:39 +00:00
Jay Foad 7d0479f2c2 Use v.data() instead of &v[0] when SmallVector v might be empty.
llvm-svn: 72210
2009-05-21 09:52:38 +00:00
Eli Friedman cec35d7e6a Clean up some unnecessary includes.
llvm-svn: 72101
2009-05-19 04:30:57 +00:00
Eli Friedman 16b7b6f511 Move clang-cc.h to lib/Frontend/Utils.h, and move the associated .cpp
files to lib/Frontend.

llvm-svn: 72099
2009-05-19 04:14:29 +00:00