summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
Commit message (Collapse)AuthorAgeFilesLines
* Allow the preprocessor to be constructed without performing target-Douglas Gregor2011-09-011-2/+6
| | | | | | | | and language-specific initialization. Use this to allow ASTUnit to create a preprocessor object *before* loading the AST file. No actual functionality change. llvm-svn: 138983
* Modules hide macro definitions by default, so that silly things likeDouglas Gregor2011-09-011-0/+1
| | | | | | | | | | | include guards don't show up as macro definitions in every translation unit that imports a module. Macro definitions can, however, be exported with the intentionally-ugly #__export_macro__ directive. Implement this feature by not even bothering to serialize non-exported macros to a module, because clients of that module need not (should not) know that these macros even exist. llvm-svn: 138943
* Clang/PNaCl: Improve test coverage for PNaClTargetInfo (type aligns), fixes ↵Ivan Krasin2011-08-291-0/+2
| | | | | | | | | | nits: - wrong alignment for double (it was 4, but 8 is desired), - added checks for _REENTRANT define, - fixed the issue that defines were not tested (because the check for inside #ifdef). llvm-svn: 138775
* Warn on missing [super finalize] calls.Nico Weber2011-08-281-0/+1
| | | | | | This matches gcc's logic. Second half of PR10661. llvm-svn: 138730
* PNaClTargetInfo: add __ELF__, _REENTRANT and _GNU_SOURCE defines and update ↵Ivan Krasin2011-08-251-0/+7
| | | | | | the test llvm-svn: 138607
* Follow up to r138470 (Add PNaCl TargetInfo). I've occasionally submitted ↵Ivan Krasin2011-08-241-1/+6
| | | | | | wrong patch. llvm-svn: 138489
* Add PNaCl TargetInfo.Ivan Krasin2011-08-241-0/+72
| | | | llvm-svn: 138470
* Remove one SourceManager::isInFileID overload and use isOffsetInFileID for ↵Argyrios Kyrtzidis2011-08-231-24/+0
| | | | | | the other. llvm-svn: 138381
* Amend r138129 (reduction of SLocEntries) which introduced performance ↵Argyrios Kyrtzidis2011-08-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | regression due to increased calls to SourceManager::getFileID. (rdar://9992664) Use a slightly different approach that is more efficient both in terms of speed (no extra getFileID calls) and in SLocEntries reduction. Comparing pre-r138129 and this patch we get: For compiling SemaExpr.cpp reduction of SLocEntries by 26%. For the boost enum library: -SLocEntries -34% (note that this was -5% for r138129) -Memory consumption -50% -PCH size -31% Reduced SLocEntries also benefit the hot function SourceManager::getFileID, evident by the reduced "FileID scans". llvm-svn: 138380
* Move a couple of SourceManager functions out-of-line; no functionality change.Argyrios Kyrtzidis2011-08-231-0/+43
| | | | llvm-svn: 138375
* Boost the efficiency of SourceManager::getMacroArgExpandedLocation.Argyrios Kyrtzidis2011-08-211-39/+101
| | | | | | | | | | | | | | | | | | Currently getMacroArgExpandedLocation is very inefficient and for the case of a location pointing at the main file it will end up checking almost all of the SLocEntries. Make it faster: -Use a map of macro argument chunks to their expanded source location. The map is for a single source file, it's stored in the file's ContentCache and lazily computed, like the source lines cache. -In SLocEntry's FileInfo add an 'unsigned NumCreatedFIDs' field that keeps track of the number of FileIDs (files and macros) that were created during preprocessing of that particular file SLocEntry. This is useful when computing the macro argument map in skipping included files while scanning for macro arg FileIDs that lexed from a specific source file. Due to padding, the new field does not increase the size of SLocEntry. llvm-svn: 138225
* Refactor common functionality into SourceManager::getFileIDSize, no ↵Argyrios Kyrtzidis2011-08-191-14/+1
| | | | | | functionality change. llvm-svn: 138127
* Implement '-Weverything', which enables all warnings except those explicitly ↵Ted Kremenek2011-08-182-7/+21
| | | | | | | | | | | | | | mapped to be ignored. Currently this includes -pedantic warnings as well; we'll need to consider whether these should be included. This works as expected with -Werror. Test cases were added to Sema/warn-unused-parameters.c, but they should probably be broken off into their own test file. llvm-svn: 137910
* "-mavx" should also enable all other SSE levels.Bruno Cardoso Lopes2011-08-181-1/+2
| | | | llvm-svn: 137905
* Fix -ferror-limit= to properly emit notes following the last errorDouglas Gregor2011-08-171-4/+6
| | | | | | messages. Fi from David Blaikie, tests from Nikola Smiljanic! llvm-svn: 137851
* Introduce SourceManager::getMacroArgExpandedLocation function.Argyrios Kyrtzidis2011-08-171-6/+75
| | | | | | | | | | | | | | | | If we pass it a source location that points inside a function macro argument, the returned location will be the macro location in which the argument was expanded. If a macro argument is used multiple times, the expanded location will be at the first expansion of the argument. e.g. MY_MACRO(foo); ^ Passing a file location pointing at 'foo', will yield a macro location where 'foo' was expanded into. Make SourceManager::getLocation call getMacroArgExpandedLocation as well. llvm-svn: 137794
* Make SourceManager::isBeforeInTranslationUnit handle macro locations correctly.Argyrios Kyrtzidis2011-08-171-7/+3
| | | | llvm-svn: 137793
* Fix C++0x narrowing conversion errors in Clang.Jeffrey Yasskin2011-08-131-2/+6
| | | | llvm-svn: 137552
* Provide diag_iterator for iterating over the built-in diagnostic IDs/names ↵Ted Kremenek2011-08-091-0/+29
| | | | | | in the internal table of DiagnosticIDs. llvm-svn: 137108
* Additional comments and whitespace.Chad Rosier2011-08-041-1/+2
| | | | llvm-svn: 136892
* Add partial support for using anonymous bitfields (e.g., int : 0) to enforce Chad Rosier2011-08-042-0/+12
| | | | | | | | | | | | | | | | alignment. This fixes cases where the anonymous bitfield is followed by a non-bitfield member. E.g., struct t4 { int foo : 1; long : 0; char bar; }; Part of rdar://9859156 llvm-svn: 136858
* Remove dead code flagged by GCC's -Wunused-but-set-variable.Benjamin Kramer2011-07-311-3/+0
| | | | llvm-svn: 136581
* Add support for the 'Q' arm memory constraint.Eric Christopher2011-07-291-1/+4
| | | | | | Fixes rdar://9866494 llvm-svn: 136524
* Make DiagnosticErrorTrap keep a count of the errors that occurred so multipleArgyrios Kyrtzidis2011-07-292-4/+10
| | | | | | | | DiagnosticErrorTraps can be composed (e.g. a trap inside another trap). Fixes http://llvm.org/PR10462 & rdar://9852007. llvm-svn: 136447
* Change SourceManager::getDataStructureSizes() to use llvm::capacity_in_bytes().Ted Kremenek2011-07-271-7/+8
| | | | llvm-svn: 136236
* clang_getCXTUResourceUsage: Report memory used by data structures in ↵Ted Kremenek2011-07-261-0/+8
| | | | | | SourceManager. llvm-svn: 136189
* After further discussion it has been determined that alignof should report Chad Rosier2011-07-262-7/+2
| | | | | | the preferred alignment. Thus, revert r135934, r135935, and r135940. llvm-svn: 136062
* Clean up as many of the comments in Basic I can find to talk in terms ofChandler Carruth2011-07-263-31/+28
| | | | | | 'expansion' rather than 'instantiation' for macro source locations. llvm-svn: 136058
* Migrate 'Instantiation' data and API bits of SLocEntry to 'Expansion'Chandler Carruth2011-07-261-17/+15
| | | | | | | | etc. With this I think essentially all of the SourceManager APIs are converted. Comments and random other bits of cleanup should be all thats left. llvm-svn: 136057
* Convert InstantiationInfo and much of the related code to ExpansionInfoChandler Carruth2011-07-261-17/+17
| | | | | | | | | and various other 'expansion' based terms. I've tried to reformat where appropriate and catch as many references in comments but I'm going to do several more passes. Also I've tried to expand parameter names to be more clear where appropriate. llvm-svn: 136056
* Rename create(MacroArg)InstantiationLoc to create(MacroArg)ExpansionLoc.Chandler Carruth2011-07-261-18/+20
| | | | llvm-svn: 136054
* Rename SourceManager (and InstantiationInfo) isMacroArgInstantiation APIChandler Carruth2011-07-261-2/+2
| | | | | | to isMacroArgExpansion. llvm-svn: 136053
* Rename getInstantiationLineNumber to getExpansionLineNumber in bothChandler Carruth2011-07-252-4/+4
| | | | | | SourceManager and FullSourceLoc. llvm-svn: 135969
* Rename getInstantiationColumnNumber to getExpansionColumnNumber in bothChandler Carruth2011-07-252-4/+4
| | | | | | SourceManager and FullSourceLoc. llvm-svn: 135965
* Rename getDecomposedInstantiationLoc to getDecomposedExpansionLoc.Chandler Carruth2011-07-251-7/+7
| | | | llvm-svn: 135962
* getInstantiationLocSlowCase -> getExpansionLocSlowCaseChandler Carruth2011-07-251-2/+2
| | | | llvm-svn: 135961
* Rename SourceManager::getImmediateInstantiationRange toChandler Carruth2011-07-251-5/+5
| | | | | | getImmediateExpansionRange. llvm-svn: 135960
* Allow target to specify about using minimum alignment vs preferred. Takes ↵Chad Rosier2011-07-252-2/+7
| | | | | | | | | care of FIXME: Override "preferred align" for double and long long for ARM apcs-gnu ABI. Also part of rdar://9802874 llvm-svn: 135940
* Rename SourceManager::getInstantiationRange to getExpansionRange.Chandler Carruth2011-07-251-3/+3
| | | | llvm-svn: 135915
* Mechanically rename SourceManager::getInstantiationLoc andChandler Carruth2011-07-252-4/+4
| | | | | | | | FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part of the API and documentation update from 'instantiation' as the term for macros to 'expansion'. llvm-svn: 135914
* Move ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon ↵Chris Lattner2011-07-231-2/+2
| | | | | | Mulder! llvm-svn: 135855
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-2311-106/+107
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Define the _MIPS_SIM builtin macro on MIPS platforms. Patch by Robert Millan!Bruno Cardoso Lopes2011-07-211-1/+19
| | | | llvm-svn: 135675
* Refactor r135502 to avoid an empty if else condition, per Eric's suggestion ↵Chad Rosier2011-07-191-4/+8
| | | | | | (good call!). llvm-svn: 135510
* Clang asserts "Invalid environment!" when using -ccc-host-triple Chad Rosier2011-07-191-0/+4
| | | | | | | | arch-pc-win32-macho (e.g., x86_64-pc-win32-macho), which appears to be a false positive. rdar://9786307 llvm-svn: 135502
* Revamp the SourceManager to separate the representation of parsedDouglas Gregor2011-07-192-170/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | source locations from source locations loaded from an AST/PCH file. Previously, loading an AST/PCH file involved carefully pre-allocating space at the beginning of the source manager for the source locations and FileIDs that correspond to the prefix, and then appending the source locations/FileIDs used for parsing the remaining translation unit. This design forced us into loading PCH files early, as a prefix, whic has become a rather significant limitation. This patch splits the SourceManager space into two parts: for source location "addresses", the lower values (growing upward) are used to describe parsed code, while upper values (growing downward) are used for source locations loaded from AST/PCH files. Similarly, positive FileIDs are used to describe parsed code while negative FileIDs are used to file/macro locations loaded from AST/PCH files. As a result, we can load PCH/AST files even during parsing, making various improvemnts in the future possible, e.g., teaching #include <foo.h> to look for and load <foo.h.gch> if it happens to be already available. This patch was originally written by Sebastian Redl, then brought forward to the modern age by Jonathan Turner, and finally polished/finished by me to be committed. llvm-svn: 135484
* simplifyChris Lattner2011-07-141-1/+1
| | | | llvm-svn: 135170
* StringMap::first() is about to start returning a StringRef, adapt.Chris Lattner2011-07-141-1/+2
| | | | llvm-svn: 135166
* Disable avx feature from corei7-avx, and use -mavx for now. Right now, if ↵Bruno Cardoso Lopes2011-07-111-1/+1
| | | | | | | | | -mavx is specified, 128 avx code is used and we're not sure yet if this the behavior we want (and if it does, some improvements are needed before relying on it). llvm-svn: 134939
* Enable "avx" feature, so it can be seen by llvmBruno Cardoso Lopes2011-07-111-1/+1
| | | | llvm-svn: 134935
OpenPOWER on IntegriCloud