summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
Commit message (Collapse)AuthorAgeFilesLines
* Switch the X86TargetInfo object from a string representation of theChandler Carruth2011-09-281-57/+179
| | | | | | | | | | | | | | | | | | selected CPU model to the enumeration. This parses the string representation once using a StringSwitch on SetCPU. It returns an error for strings which are not recognized (yay!). Finally it replaces ridiculous if-chains with switches that cover all enumerators. The last change required adding several missing entries to the features function. These were obvious on inspection. Yay for a pattern that gives warnings when we miss one. No new test cases yet, as I want to get the 64-bit errors working first. I'll then start fleshing out the testing more. Currently I'm primarily testing on Linux, but I'm hoping check whether there are interesting differences on darwin before long... llvm-svn: 140685
* Introduce an enumeration for the x86 CPUs recognized by Clang. I'veChandler Carruth2011-09-281-0/+124
| | | | | | | tried to give these nice doxyments, but if I've gotten any of my history wrong, please chime in. llvm-svn: 140684
* Clean up a bit of the uses of CPU in the TargetInfo classes. This makesChandler Carruth2011-09-281-11/+6
| | | | | | | | | | | | it an error if a CPU is provided for a target that doesn't implement logic handling CPU settings, to match the ABI settings. It also removes the CPU parameter from the getDefaultFeatures method. This parameter was always filled in with the same value as setCPU was called with, and at this point every single target implementation that referenced the CPU within this function has needed to store the CPU via setCPU anyways in order to implement other interface points. llvm-svn: 140683
* Begin fixing Clang's predefined macros for various architectures. ThisChandler Carruth2011-09-281-6/+101
| | | | | | | | | | | | | | | | is *very* much a WIP that I'll be refining over the next several commits, but I need to get this checkpoint in place for sanity. This also adds a much more comprehensive test for architecture macros, which is roughly generated by inspecting the behavior of a trunk build of GCC. It still requires some massaging, but eventually I'll even check in the script that generates these so that others can use it to append more tests for more architectures, etc. Next up is a bunch of simplification of the Targets.cpp code, followed by a lot more test cases once we can reject invalid architectures. llvm-svn: 140673
* Break SourceManager::translateFileLineCol into translateFile, no ↵Argyrios Kyrtzidis2011-09-271-5/+16
| | | | | | functionality change. llvm-svn: 140610
* Associate the macro arguments location map with a FileID insteadArgyrios Kyrtzidis2011-09-261-17/+17
| | | | | | | of a ContentCache, since multiple FileIDs can have the same ContentCache but the expanded macro arguments locations will be different. llvm-svn: 140521
* Rename DiagnosticInfo to Diagnostic as per issue 5397David Blaikie2011-09-262-8/+8
| | | | llvm-svn: 140493
* Rename DiagnosticClient to DiagnosticConsumer as per issue 5397David Blaikie2011-09-251-8/+8
| | | | llvm-svn: 140479
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-254-60/+63
| | | | llvm-svn: 140478
* Fix missing includes for llvm_unreachableDavid Blaikie2011-09-233-0/+3
| | | | llvm-svn: 140368
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-233-8/+8
| | | | llvm-svn: 140367
* PTX: Clean up target options codeJustin Holewinski2011-09-221-79/+27
| | | | llvm-svn: 140320
* In SourceManager::translateLineCol, handle the case where we are pointingArgyrios Kyrtzidis2011-09-201-4/+9
| | | | | | directly at the end of the source file. llvm-svn: 140192
* Define Mips64 TargetInfo classes.Akira Hatanaka2011-09-201-0/+144
| | | | llvm-svn: 140174
* Clean up TargetInfo class hierarchy. Define a base class from which TargetInfosAkira Hatanaka2011-09-201-126/+122
| | | | | | of Mips32 big and little endian derive. llvm-svn: 140170
* Clarify PNaCl target characteristics: set LongDoubleWidth, PtrDiffType, ↵Ivan Krasin2011-09-201-7/+5
| | | | | | | | | IntPtrType, change __builtin_va_list to from a structure to int[4] (same alignment and size, but with a simpler representation). Patch by David Meyer! llvm-svn: 140144
* [libclang] When getting a source location from a file:line:col tripletArgyrios Kyrtzidis2011-09-191-4/+8
| | | | | | | check whether the requested location points inside the precompiled preamble, in which case the returned source location will be a "loaded" one. llvm-svn: 140060
* Break SourceManager::translateFileLineCol into translateLineCol that returns theArgyrios Kyrtzidis2011-09-191-7/+22
| | | | | | source location of line:col of a specific FileID. llvm-svn: 140059
* Rename SourceLocation::getFileLocWithOffset -> getLocWithOffset.Argyrios Kyrtzidis2011-09-191-8/+8
| | | | | | It already works (and is useful with) macro locs as well. llvm-svn: 140057
* For SourceManager::isBeforeInTranslationUnit, a location pointingArgyrios Kyrtzidis2011-09-191-1/+1
| | | | | | | inside a macro argument should be regarded as coming before the location of the expanded tokens. llvm-svn: 140053
* Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear ↵Francois Pichet2011-09-172-5/+5
| | | | | | | | that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag. Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag. llvm-svn: 139987
* Teach LangOptions::resetNonModularOptions to actually do what it says it doesDouglas Gregor2011-09-151-0/+3
| | | | llvm-svn: 139791
* PTX: Define target optionsJustin Holewinski2011-09-151-0/+89
| | | | llvm-svn: 139789
* Add comment.Akira Hatanaka2011-09-141-0/+1
| | | | llvm-svn: 139700
* For modules, use a hash of the compiler version, language options, andDouglas Gregor2011-09-131-12/+22
| | | | | | | | | target triple to separate modules built under different conditions. The hash is used to create a subdirectory in the module cache path where other invocations of the compiler (with the same version, language options, etc.) can find the precompiled modules. llvm-svn: 139662
* O64 will not be supported.Akira Hatanaka2011-09-131-5/+0
| | | | llvm-svn: 139655
* mips*-*-psp is no longer supported as a target.Akira Hatanaka2011-09-131-4/+0
| | | | llvm-svn: 139654
* When building a module on-demand, clear out the "non-modular" languageDouglas Gregor2011-09-131-0/+6
| | | | | | and preprocessor options (such as macro definitions) first. llvm-svn: 139638
* Switch LangOptions over to a .def file that describes header of theDouglas Gregor2011-09-133-1/+23
| | | | | | | | | | language options. Use that .def file to declare the LangOptions class and initialize all of its members, eliminating a source of annoying initialization bugs. AST serialization changes are next up. llvm-svn: 139605
* When an import statement fails to find a module in the module cache,Douglas Gregor2011-09-121-0/+4
| | | | | | | | | but there is a corresponding umbrella header in a framework, build the module on-the-fly so it can be immediately loaded at the import statement. This is very much proof-of-concept code, with details to be fleshed out over time. llvm-svn: 139558
* Added missing initialization.Abramo Bagnara2011-09-081-0/+2
| | | | llvm-svn: 139291
* 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
OpenPOWER on IntegriCloud