summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
Commit message (Collapse)AuthorAgeFilesLines
* Ad FreeBSD ARM target info.Daniel Dunbar2009-03-231-0/+15
| | | | | | - Patch by Ed Schoeten! llvm-svn: 67527
* Eliminate post-diagnostic hooks. Instead, implement a Sema-specificDouglas Gregor2009-03-201-10/+0
| | | | | | | variant of DiagnosticBuilder that emits the template instantiation backtrace when needed. llvm-svn: 67413
* refactor some code, fixing a problem discovered by the dragonfly bsd people, ↵Chris Lattner2009-03-201-19/+31
| | | | | | | | where clang was defining "i386" even when in non-gnu mode. llvm-svn: 67378
* pass langoptions around.Chris Lattner2009-03-201-9/+10
| | | | llvm-svn: 67376
* pass LangOptions into TargetInfo::getTargetDefines, so that targetsChris Lattner2009-03-201-33/+53
| | | | | | can have language-specific defines. llvm-svn: 67375
* Bindir and Win32 builds work, so switch to .inc files. Leave the .def files ↵Sebastian Redl2009-03-191-16/+16
| | | | | | in the tree for a day or so longer. llvm-svn: 67346
* Allow notes to be printed following a fatal error, then suppress anyDouglas Gregor2009-03-191-12/+17
| | | | | | | | | | diagnostics following those notes. Make exceeding the template instantiation depth a fatal error. Thanks to Daniel for pointing out the problem! llvm-svn: 67320
* Build system changes to use TableGen to generate the variousDouglas Gregor2009-03-162-1/+11
| | | | | | | | | | | | | | | | | | diagnostics. This builds on the patch that Sebastian committed and then revert. Major differences are: - We don't remove or use the current ".def" files. Instead, for now, we just make sure that we're building the ".inc" files. - Fixed CMake makefiles to run TableGen and build the ".inc" files when needed. Tested with both the Xcode and Makefile generators provided by CMake, so it should be solid. - Fixed normal makefiles to handle out-of-source builds that involve the ".inc" files. I'll send a separate patch to the list with Sebastian's changes that eliminate the use of the .def files. llvm-svn: 67058
* Revert the switch to the tablegen diags. It fails for seperate objdir builds ↵Sebastian Redl2009-03-141-16/+16
| | | | | | and cmake builds, and I have no clue what to do about it. Revisit this after someone with a clue about the build systems has looked at it. llvm-svn: 67009
* Switch diagnostics from .def to tablegen files. Please validate the Windows ↵Sebastian Redl2009-03-141-16/+16
| | | | | | build. llvm-svn: 67007
* Add Diagnostic files for Frontend and move a couple errors over.Daniel Dunbar2009-03-121-2/+14
| | | | | | | - Notably, clang now exits with an error if it can't find a file. This flushed out a bug in the CGColorSpace.c test case. :) llvm-svn: 66789
* Driver: Use standard Diagnostic interface for diagnostics.Daniel Dunbar2009-03-121-2/+14
| | | | llvm-svn: 66786
* Clear all the linetable state in clear(), fixing problemsChris Lattner2009-03-111-0/+1
| | | | | | | with "clang t.i s.i" where the .i files contain line markers. rdar://6667812 llvm-svn: 66619
* Add a notion of "post-diagnostic hooks", which are callbacks attachedDouglas Gregor2009-03-101-0/+18
| | | | | | | | | | | | | | | | | to a diagnostic that will be invoked after the diagnostic (if it is not suppressed). The hooks are allowed to produce additional diagnostics (typically notes) that provide more information. We should be able to use this to help diagnostic clients link notes back to the diagnostic they clarify. Comments welcome; I'll write up documentation and convert other clients (e.g., overload resolution failures) if there are no screams of protest. As the first client of post-diagnostic hooks, we now produce a template instantiation backtrace when a failure occurs during template instantiation. There's still more work to do to make this output pretty, if that's even possible. llvm-svn: 66557
* Remove some now-unneeded calls to llvm::errs().flush().Daniel Dunbar2009-03-101-1/+0
| | | | llvm-svn: 66555
* Add FullSourceLoc::getDecomposedLoc.Ted Kremenek2009-03-101-0/+4
| | | | llvm-svn: 66522
* Revert my last couple patches until I can get them to not make the tests fail.Ted Kremenek2009-03-071-8/+0
| | | | llvm-svn: 66317
* Teach Diagnostic about Selector.Ted Kremenek2009-03-071-0/+8
| | | | llvm-svn: 66314
* Selector: (changes made after discussing this more with Steve Naroff)Ted Kremenek2009-03-071-1/+2
| | | | | | | | | | | - Make Selector::getAsIdentifierInfo() private. Using IdentifierInfo* in Selector is an implementation detail that clients shouldn't think about. - Modify diagnostic emission in Sema::ProcessPropertyDecl to not use Selector::getAsIdentifierInfo() (which could crash when IdentifierInfo* is null) and instead use Selector::getAsString(). - Tidy up Selector::getAsString() implementation. llvm-svn: 66313
* Handle null IdentifierInfo* in Selector::getAsString().Ted Kremenek2009-03-061-4/+6
| | | | llvm-svn: 66307
* Include information about compound statements when crashing in sema or theChris Lattner2009-03-051-11/+35
| | | | | | | | | | parser. For example, we now print out: 0. t.c:5:10: in compound statement {} 1. t.c:3:12: in compound statement {} 2. clang t.c -fsyntax-only llvm-svn: 66108
* allocate MultiKeywordSelector's out of a bump pointer allocator instead of ↵Chris Lattner2009-03-041-10/+22
| | | | | | | | | | | | malloc. This has two advantages 1) no more leaking them, 2) fewer calls to malloc. This changes us from calling malloc 3685/1390/883/2974/1185 times respectively on 16/20/24/28/32 byte objects when parsing cocoa.h with pth and -disable-free to calling it 2816/1020/702/2903/1168 times each respectively. llvm-svn: 66017
* implement support for propagating *features* down to the code generatorChris Lattner2009-03-031-8/+41
| | | | | | | | | | | and defining target-specific macros based on them (like __SSE3__ and friends). After extensive discussion with Daniel, this work will need driver support, which will translate things like -msse3 into a -mattr feature. Until this work is done, the code in clang.cpp is disabled and the X86TargetInfo ctor still defaults to SSE2. With these two things changed, this code will work. PR3634 llvm-svn: 65966
* Add plumbing to support programatically defining __SSE2__ and friends,Chris Lattner2009-03-021-6/+27
| | | | | | | even though we still hard code sse2 for now. No support for 3dnow or sse4a, but someone could add that if they desired. llvm-svn: 65886
* minor cleanups to target-specific #defines, no functionality change.Chris Lattner2009-03-021-95/+80
| | | | llvm-svn: 65885
* improve compatibility with GCC 4.4, patch by Michel Salim (PR3697)Chris Lattner2009-03-023-0/+16
| | | | llvm-svn: 65884
* TargetInfo::validateAsmConstraint now takes a reference to the full ↵Anders Carlsson2009-02-282-11/+11
| | | | | | constraints string. This will make it possible to support multi-character constraints. No functionality change (for now). llvm-svn: 65696
* Clean up and document code modification hints.Douglas Gregor2009-02-271-3/+1
| | | | llvm-svn: 65641
* Introduce code modification hints into the diagnostics system. When weDouglas Gregor2009-02-261-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | know how to recover from an error, we can attach a hint to the diagnostic that states how to modify the code, which can be one of: - Insert some new code (a text string) at a particular source location - Remove the code within a given range - Replace the code within a given range with some new code (a text string) Right now, we use these hints to annotate diagnostic information. For example, if one uses the '>>' in a template argument in C++98, as in this code: template<int I> class B { }; B<1000 >> 2> *b1; we'll warn that the behavior will change in C++0x. The fix is to insert parenthese, so we use code insertion annotations to illustrate where the parentheses go: test.cpp:10:10: warning: use of right-shift operator ('>>') in template argument will require parentheses in C++0x B<1000 >> 2> *b1; ^ ( ) Use of these annotations is partially implemented for HTML diagnostics, but it's not (yet) producing valid HTML, which may be related to PR2386, so it has been #if 0'd out. In this future, we could consider hooking this mechanism up to the rewriter to actually try to fix these problems during compilation (or, after a compilation whose only errors have fixes). For now, however, I suggest that we use these code modification hints whenever we can, so that we get better diagnostics now and will have better coverage when we find better ways to use this information. This also fixes PR3410 by placing the complaint about missing tokens just after the previous token (rather than at the location of the next token). llvm-svn: 65570
* Minor refactoring.Fariborz Jahanian2009-02-241-3/+2
| | | | llvm-svn: 65414
* patch for two things.Fariborz Jahanian2009-02-241-2/+3
| | | | | | | make sure objc2's nonfragile abi is enacted for Leopard too. add -fobjc-gc-only flag to the image_info symbol. llvm-svn: 65413
* 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
OpenPOWER on IntegriCloud