summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/LiteralSupport.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement UCN support for C string literals (C99 6.4.3) and add some very ↵Steve Naroff2009-03-301-15/+102
| | | | | | | | basic tests. Chris Goller has graciously offered to write some test to help validate UCN support. From a front-end perspective, I believe this code should work for ObjC @-strings. At the moment, I believe we need to tweak the code generation for @-strings (which doesn't appear to handle them). Will be investigating. llvm-svn: 68076
* fix some sema problems with wide strings and hook up basic codegen for them.Chris Lattner2009-02-261-9/+1
| | | | llvm-svn: 65582
* Next step toward making string diagnostics correct: handleChris Lattner2009-02-181-0/+46
| | | | | | | | | | | | | escapes in the string for subtoken positioning. This gives us working examples like: t.m:5:16: warning: field width should have type 'int', but argument has type 'unsigned int' printf("\n\n%*d", (unsigned) 1, 1); ^ ~~~~~~~~~~~~ where before the caret pointed two spaces to the left. llvm-svn: 64940
* move library-specific diagnostic headers into library private dirs. ReduceChris Lattner2009-01-291-1/+1
| | | | | | redundant #includes. Patch by Anders Johnsen! llvm-svn: 63271
* Split the single monolithic DiagnosticKinds.def file into oneChris Lattner2009-01-271-1/+1
| | | | | | | | | .def file for each library. This means that adding a diagnostic to sema doesn't require all the other libraries to be rebuilt. Patch by Anders Johnsen! llvm-svn: 63111
* minor cleanups to StringLiteralParser: no need to pass target infoChris Lattner2009-01-161-4/+12
| | | | | | | into its ctor. Also, make it handle validity checking of pascal strings instead of making clients do it. llvm-svn: 62332
* Fix a weird inconsistency with hex floats. Previously the lexer Chris Lattner2008-11-221-3/+1
| | | | | | | | | would not eat the "-1" in "0x0p-1", but LiteralSupport would accept it when extensions are on. This caused strangeness and failures when hexfloats were properly treated as an extension (not error) in LiteralSupport. llvm-svn: 59865
* remove the NumericLiteralParser::Diag helper method, inlining it intoChris Lattner2008-11-221-29/+32
| | | | | | | | its call sites. This makes it more explicit when the hasError flag is getting set and removes a confusing difference in behavior between PP.Diag and Diag in this code. llvm-svn: 59863
* Remove the last of the old-style Preprocessor::Diag methods.Chris Lattner2008-11-181-7/+7
| | | | llvm-svn: 59554
* Speed up NumericLiteralParser::GetIntegerValue.Daniel Dunbar2008-10-161-0/+20
| | | | | | | - Implement fast path when value easily fits in a uint64. - ~6x faster, translates to 1-2% on Cocoa.h llvm-svn: 57632
* Simplify overflow-on-add check in NumericLiteralParser::GetIntegerValue.Daniel Dunbar2008-10-161-2/+1
| | | | llvm-svn: 57629
* Document assumptions that NumericLiteralParser makes with an assertion.Chris Lattner2008-09-301-1/+10
| | | | llvm-svn: 56876
* Fix the root cause of PR2750 instead of the side effect.Chris Lattner2008-09-291-1/+1
| | | | | | | | | | | | NumericLiteral parser is not careful about overrun because it should never be possible. It implicitly expects that its input matched the regex for pp-constant. Because of this, it knows it can't be pointing to a prefix of something that looks like a number. This is all fine, except that __LINE__ does not prevent implicit concatenation from happening. Fix __LINE__ to not do this. llvm-svn: 56818
* Fix for PR2750; don't check for an 'e' in the trash after the token.Eli Friedman2008-09-021-1/+1
| | | | | | | | Note that this isn't really a complete fix; I think there are other potential overrun situations. I don't really know what the best systematic fix is, though. llvm-svn: 55622
* More #include cleaningDaniel Dunbar2008-08-111-1/+0
| | | | | | | | | | | - Kill unnecessary #includes in .cpp files. This is an automatic sweep so some things removed are actually used, but happen to be included by a previous header. I tried to get rid of the obvious examples and this was the easiest way to trim the #includes in one fell swoop. - We now return to regularly scheduled development. llvm-svn: 54632
* In c89 mode accept hex fp constants as an extension:Chris Lattner2008-07-251-4/+7
| | | | | | | | | | | | | | | | t2.c:1:17: warning: hexadecimal floating constants are a C99 feature long double d = 0x0.0000003ffffffff00000p-16357L; ^ instead of emitting a weird error message that doesn't make sense: t2.c:1:41: error: hexadecimal floating constants require an exponent long double d = 0x0.0000003ffffffff00000p-16357L; ^ rdar://6096838 llvm-svn: 54035
* Fix a bug reported by Kelly Wilson, where we incorrectlyChris Lattner2008-06-301-4/+15
| | | | | | rejected FP immediates like 08.123 llvm-svn: 52890
* refactor some code out into a new method.Chris Lattner2008-06-301-83/+104
| | | | llvm-svn: 52889
* for exponent-related errors, emit the diagnostic on the 'e' or 'p'.Chris Lattner2008-04-201-4/+7
| | | | llvm-svn: 49997
* when emitting diagnostics about some character in a numericChris Lattner2008-04-201-20/+26
| | | | | | | | | | | literal, indicate what character the error is about or where it would be. For example: pr2241.c:1:17: error: exponent has no digits float f[] = { 1e , 1ee0 }; ^ llvm-svn: 49996
* Support MS-specific integer suffixes (i8, i16, i32, i64, i128).Steve Naroff2008-04-041-0/+29
| | | | llvm-svn: 49229
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+691
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
OpenPOWER on IntegriCloud