summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/LiteralSupport.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-6/+4
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Fix a nasty bug where inside StringLiteralParser:Argyrios Kyrtzidis2011-05-171-1/+18
| | | | | | | | | | | | | | | | 1. We would assume that the length of the string literal token was at least 2 2. We would allocate a buffer with size length-2 And when the stars aligned (one of which would be an invalid source location due to stale PCH) The length would be 0 and we would try to allocate a 4GB buffer. Add checks for this corner case and a bunch of asserts. (We really really should have had an assert for 1.). Note that there's no test case since I couldn't get one (it was major PITA to reproduce), maybe later. llvm-svn: 131492
* fix a bunch of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129559
* Microsoft integer suffix changes:Francois Pichet2011-01-111-7/+18
| | | | | | | | | i64 is like LL i32 is like L Also set isMicrosoftInteger to true only if the suffix is well formed. llvm-svn: 123230
* Fix diagnostic for reporting bad escape sequence.Ted Kremenek2010-12-031-1/+1
| | | | | | Patch by Paul Curtis! llvm-svn: 120759
* move getSpelling from Preprocessor to Lexer, which it is more conceptually ↵Chris Lattner2010-11-171-4/+4
| | | | | | related to. llvm-svn: 119479
* propagate preprocessor out of StringLiteralParser. It is nowChris Lattner2010-11-171-10/+18
| | | | | | possible to create one without a preprocessor. llvm-svn: 119476
* push the preprocessor out of EncodeUCNEscapeChris Lattner2010-11-171-21/+14
| | | | llvm-svn: 119475
* move AdvanceToTokenCharacter and getLocForEndOfToken fromChris Lattner2010-11-171-3/+5
| | | | | | Preprocessor to Lexer where they make more sense. llvm-svn: 119474
* add a static version of PP::AdvanceToTokenCharacter.Chris Lattner2010-11-171-10/+13
| | | | llvm-svn: 119472
* push use of Preprocessor out farther.Chris Lattner2010-11-171-22/+18
| | | | llvm-svn: 119471
* push use of Preprocessor out of getOffsetOfStringByte Chris Lattner2010-11-171-6/+5
| | | | llvm-svn: 119470
* add a static form of the efficient PP::getSpelling method.Chris Lattner2010-11-171-1/+4
| | | | llvm-svn: 119469
* refactor the interface to StringLiteralParser::getOffsetOfStringByte,Chris Lattner2010-11-171-32/+39
| | | | | | pushing the dependency on the preprocessor out a bit. llvm-svn: 119468
* allow I128 suffixes in msextensions mode just like i128 suffixes, patchChris Lattner2010-10-141-1/+1
| | | | | | by Martin Vejnar! llvm-svn: 116460
* Add support for UCNs for character literalsNico Weber2010-10-091-25/+55
| | | | llvm-svn: 116129
* Add support for 4-byte UCNs like \U12345678. Warn about UCNs in c90 mode.Nico Weber2010-10-061-9/+30
| | | | llvm-svn: 115743
* Prevent warning when built with assert off.Fariborz Jahanian2010-08-311-0/+1
| | | | llvm-svn: 112680
* Some support for unicode string constantsFariborz Jahanian2010-08-311-3/+18
| | | | | | in wide strings. radar 8360841. llvm-svn: 112672
* Revert my user-defined literal commits - r1124{58,60,67} pendingAlexis Hunt2010-08-301-18/+10
| | | | | | some issues being sorted out. llvm-svn: 112493
* Implement C++0x user-defined string literals.Alexis Hunt2010-08-291-10/+18
| | | | | | | | | | The extra data stored on user-defined literal Tokens is stored in extra allocated memory, which is managed by the PreprocessorLexer because there isn't a better place to put it that makes sure it gets deallocated, but only after it's used up. My testing has shown no significant slowdown as a result, but independent testing would be appreciated. llvm-svn: 112458
* Random temporary string cleanup.Benjamin Kramer2010-08-111-4/+4
| | | | llvm-svn: 110807
* Complain when string literals are too long for the active languageDouglas Gregor2010-07-201-0/+14
| | | | | | standard's minimum requirements. llvm-svn: 108837
* Remove a dead argument to ProcessUCNEscape.Chris Lattner2010-06-151-10/+5
| | | | | | | | | | Fix string concatenation to treat escapes in concatenated strings that are wide because of other string chunks to process the escapes as wide themselves. Before we would warn about and miscompile the attached testcase. This fixes rdar://8040728 - miscompile + warning: hex escape sequence out of range llvm-svn: 106012
* Fix a miscompile of wchar pascal strings.Fariborz Jahanian2010-05-281-0/+2
| | | | | | (radar 8020384) llvm-svn: 104996
* Tell the string literal parser when it's not permitted to emitDouglas Gregor2010-05-261-20/+35
| | | | | | | | diagnostics. That would be while we're parsing string literals for the sole purpose of producing a diagnostic about them. Fixes <rdar://problem/8026030>. llvm-svn: 104684
* emit warn_char_constant_too_large at most once per literal, fixing PR6852Chris Lattner2010-04-161-1/+4
| | | | llvm-svn: 101580
* Introduce optional "Invalid" parameters to routines that invoke theDouglas Gregor2010-03-161-2/+13
| | | | | | | | | | | | | SourceManager's getBuffer() and, therefore, could fail, along with Preprocessor::getSpelling(). Use the Invalid parameters in the literal parsers (string, floating point, integral, character) to make them robust against errors that stem from, e.g., PCH files that are not consistent with the underlying file system. I still need to audit every use caller to all of these routines, to determine which ones need specific handling of error conditions. llvm-svn: 98608
* ui64, etc. are valid VS suffixes.Fariborz Jahanian2010-01-221-1/+1
| | | | | | Fixes radar 7562363. llvm-svn: 94224
* Do not parse hexadecimal floating point literals in C++0x mode because they areAlexis Hunt2010-01-101-2/+7
| | | | | | | | | | | | | | | | | | incompatible with user-defined literals, specifically with the following form: 0x1p+1 The preprocessing-number token extends only as far as the 'p'; the '+' is not included. Previously we could get away with this extension as p was an invalid suffix, but now with user-defined literals, 'p' might well be a valid suffix and we are forced to consider it as such. This patch also adds a warning in non-0x C++ modes telling the user that this extension is incompatible with C++0x that is enabled by default (previously and with other languages, we warn only with a compliance option such as -pedantic). llvm-svn: 93135
* Diagnose out-of-bounds floating-point constants. Fixes rdar://problem/6974641John McCall2009-12-241-13/+4
| | | | llvm-svn: 92127
* Eliminate a completely unnecessary buffer copy when parsing float literals.John McCall2009-12-231-6/+1
| | | | llvm-svn: 91974
* cleanup parsing of MS integer suffixes a little. this fixes PR5616Nuno Lopes2009-11-281-27/+15
| | | | | | btw, I believe that isMicrosoftInteger can go away; it's not read anywhere llvm-svn: 90036
* This fixes support for complex literals, reworked to avoid a goto, andMike Stump2009-10-081-24/+44
| | | | | | | to add a flag noting the presence of a Microsoft extension suffix (i8, i16, i32, i64). Patch by John Thompson. llvm-svn: 83591
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-91/+91
| | | | llvm-svn: 81346
* Update lexer to work with the new APFloat string parsing.Erick Tryzelaar2009-08-161-2/+6
| | | | llvm-svn: 79211
* CharLiteralParser::IsMultiChar was sometimes uninitialized.Daniel Dunbar2009-07-291-1/+2
| | | | llvm-svn: 77420
* Fix the buildAlisdair Meredith2009-07-141-2/+6
| | | | llvm-svn: 75627
* PR4353: Add support for \E as a character escape.Eli Friedman2009-06-101-1/+4
| | | | llvm-svn: 73153
* Move CharIsSigned from TargetInfo to LangOptions.Eli Friedman2009-06-051-1/+1
| | | | llvm-svn: 72928
* PR4283: Don't truncate multibyte character constants in the Eli Friedman2009-06-011-0/+1
| | | | | | preprocessor. llvm-svn: 72686
* Implement -Wfour-char-constants, which is an extension, not an extwarn,Chris Lattner2009-04-281-23/+23
| | | | | | and apparently not part of -Wall llvm-svn: 70329
* implement -WmulticharChris Lattner2009-04-281-1/+2
| | | | llvm-svn: 70315
* Get rid of some useless uses of NoExtensions. The philosophy here is Eli Friedman2009-04-281-5/+3
| | | | | | | | | | | | that if we're going to print an extension warning anyway, there's no point to changing behavior based on NoExtensions: it will only make error recovery worse. Note that this doesn't cause any behavior change because NoExtensions isn't used by the current front-end. I'm still considering what to do about the remaining use of NoExtensions in IdentifierTable.cpp. llvm-svn: 70273
* Use an APInt of target int size to detect overflow while parsing multichars.Sanjiv Gupta2009-04-211-13/+18
| | | | | | So 'abc' on i16 platforms will warn but not on i32 platforms. llvm-svn: 69653
* temporarily revert r69046Chris Lattner2009-04-141-4/+4
| | | | llvm-svn: 69054
* Literal value calculation isn't likely to overflow on targets having int as ↵Sanjiv Gupta2009-04-141-4/+4
| | | | | | 32 or less. Fixing the assert as it otherwise triggers for PIC16 which as i16 as int. llvm-svn: 69046
* ProcessUCNEscape(): Incorportate some feedback from Chris.Steve Naroff2009-04-011-17/+21
| | | | llvm-svn: 68198
* Fix pascal string support; testcase from mailing list message.Eli Friedman2009-04-011-3/+4
| | | | llvm-svn: 68181
* Incorporate feedback from Eli.Steve Naroff2009-03-311-17/+11
| | | | llvm-svn: 68107
OpenPOWER on IntegriCloud