summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
Commit message (Collapse)AuthorAgeFilesLines
* add support for amd64-*, patch by Brooks Davis!Chris Lattner2009-02-201-1/+1
| | | | llvm-svn: 65124
* replace a dirty hack with a clean solution. Too bad we can't Chris Lattner2009-02-191-1/+3
| | | | | | use Blocks for our callbacks ;-) llvm-svn: 65083
* Fix a long standard problem with clang retaining "too much" sugar Chris Lattner2009-02-191-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | information about types. We often print diagnostics where we say "foo_t" is bad, but the user doesn't know how foo_t is declared (because it is a typedef). Fix this by expanding sugar when present in a diagnostic (and not one of a few special cases, like vectors). Before: t.m:5:2: error: invalid operands to binary expression ('typeof(P)' and 'typeof(F)') MAX(P, F); ^~~~~~~~~ t.m:1:78: note: instantiated from: #define MAX(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; }) ^ After: t.m:5:2: error: invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float')) MAX(P, F); ^~~~~~~~~ t.m:1:78: note: instantiated from: #define MAX(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; }) ^ llvm-svn: 65081
* add an accessor.Chris Lattner2009-02-171-0/+9
| | | | llvm-svn: 64760
* add an accessor.Chris Lattner2009-02-171-0/+12
| | | | llvm-svn: 64758
* fix a minor bug with my previous patchChris Lattner2009-02-171-1/+3
| | | | llvm-svn: 64747
* fix notes so that they are always filtered with the same logic Chris Lattner2009-02-171-45/+79
| | | | | | | | | as the last non-note diagnostic that preceeded them. This ensures that diagnostics in main files which have notes with locations in system headers get all the bits and pieces emitted or not in a unit. This fixes PR3215. llvm-svn: 64746
* Supply the header corresponding to a library builtin as a separate argument ↵Douglas Gregor2009-02-161-2/+5
| | | | | | to the LIBBUILTIN macro llvm-svn: 64676
* add a new SourceManager::getInstantiationRange helper method.Chris Lattner2009-02-151-0/+18
| | | | llvm-svn: 64606
* track "just a little more" location information for macro instantiations.Chris Lattner2009-02-151-7/+18
| | | | | | | | | | | | Now instead of just tracking the expansion history, also track the full range of the macro that got replaced. For object-like macros, this doesn't change anything. For _Pragma and function-like macros, this means we track the locations of the ')'. This is required for PR3579 because apparently GCC uses the line of the ')' of a function-like macro as the location to expand __LINE__ to. llvm-svn: 64601
* Add -ffreestanding to suppress the implicit declaration of library builtins ↵Douglas Gregor2009-02-141-2/+2
| | | | | | like printf and malloc. Fixes PR3586 llvm-svn: 64566
* Define __ELF__ on FreeBSD. Patch by Roman Divacky!Anton Korobeynikov2009-02-141-1/+1
| | | | llvm-svn: 64557
* Fix the build on win32.Cedric Venet2009-02-141-0/+6
| | | | llvm-svn: 64556
* Define __ELF__ for linux systems.Argyrios Kyrtzidis2009-02-141-0/+1
| | | | llvm-svn: 64553
* Give TargetInfo a new IntPtrType to hold the intptr_t type forChris Lattner2009-02-132-0/+3
| | | | | | | | | | a target. Make Preprocessor.cpp define a new __INTPTR_TYPE__ macro based on this. On linux/32, set intptr_t to int, instead of long. This fixes PR3563. llvm-svn: 64495
* Make nonfragile-abi the default for darwin's 64bitFariborz Jahanian2009-02-121-1/+5
| | | | | | abi for objective-c programs. llvm-svn: 64386
* FileManager:Ted Kremenek2009-02-121-6/+4
| | | | | | | | | - set the 'StatSysCallCache' object using a setter method instead of FileManager's constructor. This allows the cache to be installed after the FileManager object is created. - Add 'file mode' to FileEntry (useful for stat caching) llvm-svn: 64351
* search and replaceo? Chris Lattner2009-02-121-1/+1
| | | | llvm-svn: 64348
* Add lightweight shim "clang::StatSysCallCache" that caches 'stat' system callsTed Kremenek2009-02-121-8/+10
| | | | | | | | | | for use by FileManager. FileManager now takes a StatSysCallCache* in its constructor (which defaults to NULL). This will be used for evaluating whether or not caching 'stat' system calls in PTH is a performance win. This shim adds no observable performance impact in the case where the 'StatSysCallCache*' is null. llvm-svn: 64345
* simplify and refactor a bunch of type definition code in PreprocessorChris Lattner2009-02-061-0/+16
| | | | | | predefines buffer initialization. llvm-svn: 63919
* don't emit any diagnostics after a fatal one.Chris Lattner2009-02-061-1/+9
| | | | llvm-svn: 63914
* add support to the diagnostics machinery for mapping warnings andChris Lattner2009-02-051-0/+5
| | | | | | errors to 'fatal' error severity. llvm-svn: 63894
* make clang agree with gcc 4.2's x86-64 predefines and settings.Chris Lattner2009-02-051-0/+4
| | | | llvm-svn: 63849
* fix some differences between apple gcc and clang on darwin/x86-32.Chris Lattner2009-02-051-0/+4
| | | | llvm-svn: 63846
* Some name-lookup-related fixes, from Piotr Rak!Douglas Gregor2009-02-041-0/+1
| | | | | | | | | | | | | - Changes Lookup*Name functions to return NamedDecls, instead of Decls. Unfortunately my recent statement that it will simplify lot of code, was not quite right, but it simplifies some... - Makes MergeLookupResult SmallPtrSet instead of vector, following Douglas suggestions. - Adds %qN format for printing qualified names to Diagnostic. - Avoids searching for using-directives in Scopes, which are not DeclScope, during unqualified name lookup. llvm-svn: 63739
* Implement handling of file entry/exit notifications from GNUChris Lattner2009-02-041-7/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | line markers, including maintenance of the virtual include stack. For something like this: # 42 "bar.c" 1 # 142 "bar2.c" 1 #warning zappa # 92 "bar.c" 2 #warning gonzo # 102 "foo.c" 2 #warning bonkta we now produce these three warnings: #1: In file included from foo.c:3: In file included from bar.c:42: bar2.c:143:2: warning: #warning zappa #warning zappa ^ #2: In file included from foo.c:3: bar.c:92:2: warning: #warning gonzo #warning gonzo ^ #3: foo.c:102:2: warning: #warning bonkta #warning bonkta ^ llvm-svn: 63722
* make getFileCharacteristic linetable aware. line markers that Chris Lattner2009-02-041-0/+32
| | | | | | play around with the 'is system header' bit now function correctly. llvm-svn: 63720
* propagate linemarker flags down into the the line table, currentlyChris Lattner2009-02-041-6/+87
| | | | | | ignoring include stack push/pop info though. llvm-svn: 63719
* replace gimpy linear search with svelte binary search ;-)Chris Lattner2009-02-041-7/+17
| | | | llvm-svn: 63717
* make my atrocious linear search at least search in the order that isChris Lattner2009-02-041-5/+4
| | | | | | more likely to hit. llvm-svn: 63714
* add commentChris Lattner2009-02-041-1/+1
| | | | llvm-svn: 63712
* add the difference in the line marker phys line number and theChris Lattner2009-02-041-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | query point to the returned presumed location. We now produce: foo.h:92:2: warning: #warning blarg! #warning blarg! ^ foo.h:93:2: warning: #warning blarg! #warning blarg! ^ foo.h:94:2: warning: #warning blarg! #warning blarg! ^ for: #line 92 "foo.h" #warning blarg! #warning blarg! #warning blarg! blarg indeed! llvm-svn: 63710
* add really really trivial #line support, where #line now makes every Chris Lattner2009-02-041-8/+54
| | | | | | | | | | | | | | | | | | | | location below it report as coming from the #line location. For example, with: #line 92 "foo.h" #warning blarg! #warning blarg! we now emit: foo.h:92:2: warning: #warning blarg! #warning blarg! ^ foo.h:92:2: warning: #warning blarg! #warning blarg! ^ llvm-svn: 63709
* lower the interface to getLineNumber like we did forChris Lattner2009-02-042-21/+23
| | | | | | | | getColumnNumber. This fixes a FIXME in SourceManager::getPresumedLoc because we now just decompose the sloc once. llvm-svn: 63701
* make SM::getColumnNumber take a predecomposed FileID/offset, whichChris Lattner2009-02-042-21/+19
| | | | | | | | makes it clear to clients that they have to pick an instantiation or spelling location before calling it and allows optimization based on that. llvm-svn: 63698
* build per-fid linetable entries.Chris Lattner2009-02-041-12/+39
| | | | llvm-svn: 63694
* more plumbing for #line propagation. Use happy bit #3 Chris Lattner2009-02-031-1/+21
| | | | | | out of FileInfo :) llvm-svn: 63672
* stub out basic #line handling calls.Chris Lattner2009-02-031-0/+9
| | | | llvm-svn: 63667
* reclaim my precious bit in FileInfo by ensuring that ContentCache objectsChris Lattner2009-02-031-7/+12
| | | | | | are 8-byte aligned. llvm-svn: 63630
* switch SourceManager from using an std::map and std::list of Chris Lattner2009-02-031-27/+42
| | | | | | | | | ContentCache objects to using a densemap and list, and allocating the ContentCache objects from a bump pointer. This does not speed up or slow down things substantially, but gives us control over their alignment. llvm-svn: 63628
* next round of diagnostics cleanups, moving some Chris Lattner2009-01-291-26/+26
| | | | | | | diags around, eliminating #defines, etc. Patch by Anders Johnsen! llvm-svn: 63318
* Fix -Wimplicit-function-declaration, which required some refactoring andChris Lattner2009-01-291-27/+10
| | | | | | changes in various diagnostics code. llvm-svn: 63282
* Add method FullSourceLoc::getBufferData().Ted Kremenek2009-01-281-0/+6
| | | | llvm-svn: 63229
* long long and double have 64-bit alignment on x86-64.Chris Lattner2009-01-281-0/+1
| | | | llvm-svn: 63191
* On Windows use a BumpPtrAllocator for the UniqueFileContainer's StringMap.Ted Kremenek2009-01-281-1/+1
| | | | llvm-svn: 63162
* FileManager: Use a BumpPtrAllocator for the StringMaps DirEntries and ↵Ted Kremenek2009-01-281-1/+0
| | | | | | | | | | FileEntries. Performance impact (clang -fsyntax-only INPUTS/Cocoa_h.m): non-PTH: 0.4% improvement PTH: 0.8% improvement llvm-svn: 63159
* Add a some comments to designate Windows-specific/Unix-specific code. No ↵Ted Kremenek2009-01-281-0/+12
| | | | | | functionality change. llvm-svn: 63157
* If an input constraint refers to an output constraint, it should have the ↵Anders Carlsson2009-01-271-0/+5
| | | | | | same constraint info as the output constraint. Fixes PR3417 llvm-svn: 63127
* Split the single monolithic DiagnosticKinds.def file into oneChris Lattner2009-01-271-8/+91
| | | | | | | | | .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
* Introduce a new PresumedLoc class to represent the concept of a locationChris Lattner2009-01-272-37/+44
| | | | | | | | | | | | | | | | | | | as reported to the user and as manipulated by #line. This is what __FILE__, __INCLUDE_LEVEL__, diagnostics and other things should follow (but not dependency generation!). This patch also includes several cleanups along the way: - SourceLocation now has a dump method, and several other places that did similar things now use it. - I cleaned up some code in AnalysisConsumer, but it should probably be simplified further now that NamedDecl is better. - TextDiagnosticPrinter is now simplified and cleaned up a bit. This patch is a prerequisite for #line, but does not actually provide any #line functionality. llvm-svn: 63098
OpenPOWER on IntegriCloud