summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
Commit message (Collapse)AuthorAgeFilesLines
...
* Basic: import IntrusiveRefCntPtr<> into clang namespaceDylan Noblesmith2012-02-201-2/+2
| | | | | | | The class name is long enough without the llvm:: added. Also bring in RefCountedBase and RefCountedBaseVPTR. llvm-svn: 150958
* Advertize support for constexpr.Richard Smith2012-02-141-1/+1
| | | | llvm-svn: 150524
* Implement warning for non-wide string literals with an unexpected encoding. ↵Eli Friedman2012-02-111-15/+40
| | | | | | Downgrade error for non-wide character literals with an unexpected encoding to a warning for compatibility with gcc and older versions of clang. <rdar://problem/10837678>. llvm-svn: 150295
* Fixing hex floating literal support so that it handles 0x.2p2 properly.Aaron Ballman2012-02-081-6/+11
| | | | llvm-svn: 150072
* Revert my patches which removed Diagnostic.h includes by moving some ↵Benjamin Kramer2012-02-071-15/+0
| | | | | | | | | | | | | | | | | | operator overloads out of line. This seems to negatively affect compile time onsome ObjC tests (which use a lot of partial diagnostics I assume). I have to come up with a way to keep them inline without including Diagnostic.h everywhere. Now adding a new diagnostic requires a full rebuild of e.g. the static analyzer which doesn't even use those diagnostics. This reverts commit 6496bd10dc3a6d5e3266348f08b6e35f8184bc99. This reverts commit 7af19b817ba964ac560b50c1ed6183235f699789. This reverts commit fdd15602a42bbe26185978ef1e17019f6d969aa7. This reverts commit 00bd44d5677783527d7517c1ffe45e4d75a0f56f. This reverts commit ef9b60ffed980864a8db26ad30344be429e58ff5. llvm-svn: 150006
* Hex literals without a significand no longer crash the lexer. Fixes bug 7910Aaron Ballman2012-02-071-0/+6
| | | | | | Patch by Eitan Adler llvm-svn: 149984
* Move instantiateTemplateAttribute into the sema namespace, make helpers static.Benjamin Kramer2012-02-061-1/+2
| | | | llvm-svn: 149864
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-0512-42/+42
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Basic: import OwningPtr<> into clang namespaceDylan Noblesmith2012-02-052-4/+4
| | | | llvm-svn: 149798
* Move a method from IdentifierTable.h out of line and remove the SmallString ↵Benjamin Kramer2012-02-043-3/+3
| | | | | | | | include. Fix all the transitive include users. llvm-svn: 149783
* Remove Diagnostic.h include from Preprocessor.h.Benjamin Kramer2012-02-041-0/+15
| | | | | | | - Move the offending methods out of line and fix transitive includers. - This required changing an enum in the PPCallback API into an unsigned. llvm-svn: 149782
* Change Lexer::makeFileCharRange() to have it accept a CharSourceRangeArgyrios Kyrtzidis2012-02-031-24/+35
| | | | | | | instead of a SourceRange, and handle the case where the range is a char (not token) range. llvm-svn: 149677
* Back out my heinous hack that tricked the module generation mechanismDouglas Gregor2012-02-021-5/+52
| | | | | | | | | | | | | | | | | | | | into using non-absolute system includes (<foo>)... ... and introduce another hack that is simultaneously more heineous and more effective. We whitelist Clang-supplied headers that augment or override system headers (such as float.h, stdarg.h, and tgmath.h). For these headers, Clang does not provide a module mapping. Instead, a system-supplied module map can refer to these headers in a system module, and Clang will look both in its own include directory and wherever the system-supplied module map suggests, then adds either or both headers. The end result is that Clang-supplied headers get merged into the system-supplied module for the C standard library. As a drive-by, fix up a few dependencies in the _Builtin_instrinsics module. llvm-svn: 149611
* Per discussion on cfe-dev, remove '#error' and '#warning' from diagnostic text.Ted Kremenek2012-02-021-2/+10
| | | | llvm-svn: 149566
* objc2: add __has_feature(objc_default_synthesize_properties).Fariborz Jahanian2012-02-021-0/+1
| | | | | | // rdar://10770497 llvm-svn: 149565
* fix a crash on:Chris Lattner2012-01-311-1/+2
| | | | | | | | | | __has_builtin in an empty file, as we were overwriting the EOF token. Overwriting an arbitrary token never seems like a good idea in the error case. This fixes a bug reported on the GCC list :) llvm-svn: 149397
* Thread a TargetInfo through to the module map; we'll need it forDouglas Gregor2012-01-303-6/+20
| | | | | | target-specific module requirements. llvm-svn: 149224
* Implement code completion support for module import declarations, e.g.,Douglas Gregor2012-01-291-0/+55
| | | | | | | | | | | | @import <complete with module names here> or @import std.<complete with submodule names here> Addresses <rdar://problem/10710117>. llvm-svn: 149199
* Rework HeaderSearch's interface for getting a module from a name andDouglas Gregor2012-01-292-97/+72
| | | | | | | | | for getting the name of the module file, unifying the code for searching for a module with a given name (into lookupModule()) and separating out the mapping to a module file (into getModuleFileName()). No functionality change. llvm-svn: 149197
* Introduce module attributes into the module map grammar, along with aDouglas Gregor2012-01-272-12/+112
| | | | | | | | | | | | | single attribute ("system") that allows us to mark a module as being a "system" module. Each of the headers that makes up a system module is considered to be a system header, so that we (for example) suppress warnings there. If a module is being inferred for a framework, and that framework directory is within a system frameworks directory, infer it as a system framework. llvm-svn: 149143
* Only mark an IdentifierInfo as having changed since deserializationDouglas Gregor2012-01-241-3/+4
| | | | | | | | when it actually has changed (and not, e.g., when we've simply attached a deserialized macro definition). Good for ~1.5% reduction in module file size, mostly in the identifier table. llvm-svn: 148808
* Improve Lexer::getImmediateMacroName to take into account inner macrosArgyrios Kyrtzidis2012-01-231-3/+29
| | | | | | | | | of macro arguments. For "MAC1( MAC2(foo) )" and location of 'foo' token it would return "MAC1" instead of "MAC2". llvm-svn: 148704
* Enhance Lexer::makeFileCharRange to check for ranges inside a macro argumentArgyrios Kyrtzidis2012-01-201-11/+61
| | | | | | | expansion, in which case it returns a file range in the location where the argument was spelled. llvm-svn: 148551
* Introduce Lexer::getSourceText() that returns a string for the sourceArgyrios Kyrtzidis2012-01-191-0/+42
| | | | | | that the given source range encompasses. llvm-svn: 148481
* Introduce Lexer::makeFileCharRange() that accepts a token source rangeArgyrios Kyrtzidis2012-01-191-0/+29
| | | | | | and returns a character range with file locations. llvm-svn: 148480
* For Lexer's isAt[Start/End]OfMacroExpansion add an out parameter for the macroArgyrios Kyrtzidis2012-01-191-15/+21
| | | | | | | | | start/end location. It is commonly needed after calling the function; with this way we avoid recalculating it. llvm-svn: 148479
* Refactor: Pull getImmediateMacroName() out of DiagnosticRenderer andAnna Zaks2012-01-181-0/+21
| | | | | | into Lexer and Preprocessor; making it widely available. llvm-svn: 148410
* stop claiming unicode escape sequences are too long in strings, because they ↵Seth Cantrell2012-01-181-2/+0
| | | | | | never are llvm-svn: 148391
* Improves support for Unicode in character literalsSeth Cantrell2012-01-181-64/+115
| | | | | | | | | | | | | | | | | | | | Updates ProcessUCNExcape() for C++. C++11 allows UCNs in character and string literals that represent control characters and basic source characters. Also C++03 allows UCNs that refer to surrogate codepoints. UTF-8 sequences in character literals are now handled as single c-chars. Added error for multiple characters in Unicode character literals. Added errors for when a the execution charset encoding of a c-char cannot be represented as a single code unit in the associated character type. Note that for the purposes of this error the asso- ciated character type for a narrow character literal is char, not int, even though in C narrow character literals have type int. llvm-svn: 148389
* Remove unreachable code in Clang. (replace with llvm_unreachable where ↵David Blaikie2012-01-176-10/+0
| | | | | | appropriate or when GCC requires it) llvm-svn: 148292
* Some improvements to the handling of C11 atomic types:David Chisnall2012-01-161-0/+4
| | | | | | | | | | | | | | | | | | - Add atomic-to/from-nonatomic cast types - Emit atomic operations for arithmetic on atomic types - Emit non-atomic stores for initialisation of atomic types, but atomic stores and loads for every other store / load - Add a __atomic_init() intrinsic which does a non-atomic store to an _Atomic() type. This is needed for the corresponding C11 stdatomic.h function. - Enables the relevant __has_feature() checks. The feature isn't 100% complete yet, but it's done enough that we want people testing it. Still to do: - Make the arithmetic operations on atomic types (e.g. Atomic(int) foo = 1; foo++;) use the correct LLVM intrinsic if one exists, not a loop with a cmpxchg. - Add a signal fence builtin - Properly set the fenv state in atomic operations on floating point values - Correctly handle things like _Atomic(_Complex double) which are too large for an atomic cmpxchg on some platforms (this requires working out what 'correctly' means in this context) - Fix the many remaining corner cases llvm-svn: 148242
* Two variables had been added for an assert, but their values wereChandler Carruth2012-01-151-3/+3
| | | | | | | | | | re-computed rather than the variables be re-used just after the assert. Just use the variables since we have them already. Fixes an unused variable warning. Also fix an 80-column violation. llvm-svn: 148212
* When inferring a module for a framework, first determine whether thatDouglas Gregor2012-01-131-3/+44
| | | | | | | | | | | | | framework is actually a subframework within a top-level framework. If so, only infer a module for the top-level framework and then dig out the appropriate submodule. This helps us cope with an amusing subframeworks anti-pattern, where one uses -F <framework>/Frameworks to get direct include access to the subframeworks of a framework (which otherwise would not be permitted). llvm-svn: 148148
* Don't infer a submodule for a framework's private header, at least for now.Douglas Gregor2012-01-131-14/+1
| | | | llvm-svn: 148117
* Revert previous commit. Something has gone wonky with my local configurationDouglas Gregor2012-01-131-1/+0
| | | | llvm-svn: 148084
* When inferring a module map for a framework, add the 'private'Douglas Gregor2012-01-131-0/+1
| | | | | | | requirement to headers under PrivateHeaders. We don't want to build them as part of the module (yet). llvm-svn: 148082
* When inferring a submodule ID during module creation, look up theDouglas Gregor2012-01-061-5/+16
| | | | | | | | | | include stack to find the first file that is known to be part of the module. This copes with situations where the module map doesn't completely specify all of the headers that are involved in the module, which can come up when there are very strange #include_next chains (e.g., with weird compiler/stdlib headers like stdarg.h or float.h). llvm-svn: 147662
* Fix a memory leak of PragmaNamespaces, rdar://10611796.Argyrios Kyrtzidis2012-01-061-1/+3
| | | | llvm-svn: 147635
* When loading an AST file, set SourceManager::MainFileID to the main file of ↵Argyrios Kyrtzidis2012-01-051-12/+16
| | | | | | | | the AST file, as suggested by Tom Honermann. llvm-svn: 147612
* If we already have a definition for a top-level module that we deserialized ↵Douglas Gregor2012-01-051-0/+13
| | | | | | from a module file, don't bother parsing a new definition llvm-svn: 147574
* Store the submodules of a module in source order, as they are storedDouglas Gregor2012-01-041-25/+11
| | | | | | | | in the module map. This provides a bit more predictability for the user, as well as eliminating the need to sort the submodules when serializing them. llvm-svn: 147564
* Add __has_feature(modules) to indicate when modules are available (inDouglas Gregor2012-01-041-1/+2
| | | | | | | | | any language variant), and restrict __has_feature(objc_modules) to mean that we also have the Objective-C @import syntax. I anticipate __has_feature(cxx_modules) and/or __has_feature(c_modules) for when we nail down the module syntax for C/C++. llvm-svn: 147548
* Don't treat 'import' as a contextual keyword when we're in a caching lexer, ↵Douglas Gregor2012-01-042-11/+20
| | | | | | or when modules are disabled. llvm-svn: 147524
* Add __has_feature(objc_modules)Douglas Gregor2012-01-031-0/+1
| | | | llvm-svn: 147482
* Re-uglify #public and #private to #__public_macro and #__private_macro.Douglas Gregor2012-01-031-6/+6
| | | | llvm-svn: 147469
* Eliminate the uglified keyword __import_module__ for importingDouglas Gregor2012-01-032-14/+9
| | | | | | | | | | | | | modules. This leaves us without an explicit syntax for importing modules in C/C++, because such a syntax needs to be discussed first. In Objective-C/Objective-C++, the @import syntax is used to import modules. Note that, under -fmodules, C/C++ programs can import modules via the #include mechanism when a module map is in place for that header. This allows us to work with modules in C/C++ without committing to a syntax. llvm-svn: 147467
* Under -fmodules, accept #public <macroname> and #private <macroname>Douglas Gregor2012-01-031-11/+16
| | | | | | | to make a macro public (the default for headers) or private, respectively. llvm-svn: 147455
* Introduce a non-uglified syntax for module imports in Objective-C:Douglas Gregor2012-01-031-5/+11
| | | | | | @import identifier [. identifier]* ; llvm-svn: 147452
* Add a "Modules" language option, which subsumes the previousDouglas Gregor2012-01-032-3/+2
| | | | | | "AutoModuleImport" preprocessor option and is tied to -fmodules. llvm-svn: 147448
* Added a missing case for -Wdisabled-macro-expansion.Abramo Bagnara2012-01-021-1/+3
| | | | llvm-svn: 147433
OpenPOWER on IntegriCloud