summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
Commit message (Collapse)AuthorAgeFilesLines
...
* reimplement the caching in the SourceManager::isBeforeInTranslationUnit()Chris Lattner2010-05-071-20/+31
| | | | | | | | method to be correct. Right now it correctly computes the cache, then goes ahead and computes the result the hard way, then asserts that they match. Next I'll actually turn it on. llvm-svn: 103231
* Basic: Update getClangRepositoryPath for my change to integration branch layout.Daniel Dunbar2010-05-061-1/+2
| | | | llvm-svn: 103192
* Workaround a really serious caching bug in ↵Ted Kremenek2010-05-061-0/+5
| | | | | | | | | | SourceManager::isBeforeInTranslationUnit() where the method will sometimes return different results for the same input SourceLocations. I haven't unraveled this method completely yet, so this truly is a workaround until a better fix comes along. llvm-svn: 103143
* When -fdiagnostics-print-source-range-info is specified,Chris Lattner2010-05-041-0/+29
| | | | | | | | | | | | | | | | | | | | | | | print the diagnostic category number in the [] at the end of the line. For example: $ cat t.c #include <stdio.h> void foo() { printf("%s", 4); } $ clang t.c -fsyntax-only -fdiagnostics-print-source-range-info t.c:3:11:{3:10-3:12}{3:15-3:16}: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,1] printf("%s", 4); ~^ ~ 1 warning generated. Clients that want category information can now pick the number out of the output, rdar://7928231. More coming. llvm-svn: 103053
* add the ability to associate 'category' names with diagnosticsChris Lattner2010-05-041-4/+6
| | | | | | | | | and diagnostic groups. This allows the compiler to group diagnostics together (e.g. "Logic Warning", "Format String Warning", etc) like the static analyzer does. This is not exposed through anything in the compiler yet. llvm-svn: 103051
* david conrad points out that {|} in inline assembly on arm are not asmChris Lattner2010-04-232-0/+5
| | | | | | variants. This fixes neon inline asm which my patch for PR6780 broke. llvm-svn: 102181
* another tweak for haiku support, patch by Paul Davey!Chris Lattner2010-04-221-0/+2
| | | | llvm-svn: 102098
* ARM/APCS: Don't respect bit-field types when laying out structures.Daniel Dunbar2010-04-221-0/+4
| | | | | | | | | | | - This fixes the last known ABI issues with ARM/APCS. - I've run the first 1k ABITests with '--no-unsigned --no-vector --no-complex' on {armv6, armv7} x {-mno-thumb, -mthumb}, and the first 10k tests for armv7 -mthumb, for both function return types and single argument calls. These all pass now (they failed horribly before without --no-bitfield). llvm-svn: 102070
* Sink the _GNU_SOURCE definition down into the target configuration,Douglas Gregor2010-04-211-0/+4
| | | | | | | and only define it where we know we need it---Linux and Cygwin. Thanks to Chris for the prodding. llvm-svn: 101989
* change FullSourceLoc to have a *const* SourceManager&, eliminatingChris Lattner2010-04-201-4/+1
| | | | | | a const_cast. llvm-svn: 101940
* push some source location information down through the compiler,Chris Lattner2010-04-201-20/+32
| | | | | | | | into ContentCache::getBuffer. This allows it to produce diagnostics on the broken #include line instead of without a location. llvm-svn: 101939
* enhance sourcemgr to detect various UTF BOM's and emit a fatal errorChris Lattner2010-04-201-0/+35
| | | | | | | | | about it instead of producing tons of garbage from the lexer. It would be even better for sourcemgr to dynamically transcode (e.g. from UTF16 -> UTF8). llvm-svn: 101924
* Introduce a limit on the depth of the template instantiation backtraceDouglas Gregor2010-04-201-1/+2
| | | | | | | | | | | | | | | | we will print with each error that occurs during template instantiation. When the backtrace is longer than that, we will print N/2 of the innermost backtrace entries and N/2 of the outermost backtrace entries, then skip the middle entries with a note such as: note: suppressed 2 template instantiation contexts; use -ftemplate-backtrace-limit=N to change the number of template instantiation entries shown This should eliminate some excessively long backtraces that aren't providing any value. llvm-svn: 101882
* Add support for '-fgnu-keywords' and '-fasm' to Clang's driver. They are notChandler Carruth2010-04-171-3/+3
| | | | | | | | implemented precisely the same as GCC, but the distinction GCC makes isn't useful to represent. This allows parsing code which uses GCC-specific keywords ('asm', etc.) without parsing in a fully GNU mode. llvm-svn: 101667
* clang -cc1: Add a -fno-bitfield-type-align option, for my own testing purposes.Daniel Dunbar2010-04-151-2/+3
| | | | llvm-svn: 101370
* Tweak spelling (Bitfield -> BitField)Daniel Dunbar2010-04-151-1/+1
| | | | llvm-svn: 101369
* Add TargetInfo::useBitfieldTypeAlignment().Daniel Dunbar2010-04-151-3/+3
| | | | | | | | | | | | | | | - Used to determine whether the alignment of the type in a bit-field is respected when laying out structures. The default is true, targets can override this as needed. - This is designed to correspond to the PCC_BITFIELD_TYPE_MATTERS macro in gcc. The AST/Sema implementation only affects one line, unless I have forgotten something. I'd appreciate further review. - IRgen still needs to be updated to fully support this (which is effectively PR5591). llvm-svn: 101356
* Once we've emitted a fatal diagnostic, keep counting errors but with aDouglas Gregor2010-04-141-1/+8
| | | | | | | | | | | | | | separate count of "suppressed" errors. This way, semantic analysis bits that depend on the error count to determine whether problems occured (e.g., some template argument deduction failures, jump-scope checking) will not get confused. The actual problem here is that a missing #include (which is a fatal error) could cause the jump-scope checker to run on invalid code, which it is not prepared to do. Trivial fix for both <rdar://problem/7775941> and <rdar://problem/7775709>. llvm-svn: 101297
* fix PR6814 - Only print [-pedantic] on a diagnostic if -pedantic Chris Lattner2010-04-121-4/+11
| | | | | | | | actually turned it on. If a diag is produced by a warning which is an extension but defaults to on, and has no warning group, don't print any option info. llvm-svn: 101071
* Fix null dereference in 'WriteSourceLocation' when the FileEntry is null.Ted Kremenek2010-04-121-11/+18
| | | | llvm-svn: 101060
* add haiku support, patch by Paul Davey!Chris Lattner2010-04-111-0/+19
| | | | llvm-svn: 100982
* Disable diag::err_file_modified on Win32 completely, until someone cares to fixDaniel Dunbar2010-04-101-10/+12
| | | | | | | it. PR6812. - This is another attempt at silencing annoying buildbot failures. llvm-svn: 100914
* On Windows, disable the modification-time check for files used inDouglas Gregor2010-04-091-5/+11
| | | | | | | | precompiled headers and/or when reading the contents of the file into memory. These checks seem to be causing spurious regression-test failures on Windows. llvm-svn: 100866
* add clang -cc1 level support for "-ferror-limit 42"Chris Lattner2010-04-071-2/+2
| | | | llvm-svn: 100687
* add capabilities to stop emitting errors after some limit.Chris Lattner2010-04-071-0/+7
| | | | | | Right now the limit is 0 (aka disabled) llvm-svn: 100684
* Instead of counting totally diagnostics, split the count into a countChris Lattner2010-04-071-2/+5
| | | | | | | | | | | | | | | of errors and warnings. This allows us to emit something like this: 2 warnings and 1 error generated. instead of: 3 diagnostics generated. This also stops counting 'notes' because they are just follow-on information about the previous diag, not a diagnostic in themselves. llvm-svn: 100675
* Add option and macro definition for AES instructions. Now produces realEric Christopher2010-04-021-2/+20
| | | | | | assembly for testcases. llvm-svn: 100253
* Reinstate my CodeModificationHint -> FixItHint renaming patch, withoutDouglas Gregor2010-03-311-5/+5
| | | | | | the C-only "optimization". llvm-svn: 100022
* Revert r100008, which inexplicably breaks the clang-i686-darwin10 builderDouglas Gregor2010-03-311-5/+5
| | | | llvm-svn: 100018
* Rename CodeModificationHint to FixItHint, since we've been using theDouglas Gregor2010-03-311-5/+5
| | | | | | | term "fix-it" everywhere and even *I* get tired of long names sometimes. No functionality change. llvm-svn: 100008
* Optimize PartialDiagnostic's memory-allocation behavior by placing aDouglas Gregor2010-03-291-0/+11
| | | | | | | | | | | | | | cache of PartialDiagnostic::Storage objects into an allocator within the ASTContext. This eliminates a significant amount of malloc traffic, for a 10% performance improvement in -fsyntax-only wall-clock time with 403.gcc's combine.c. Also, eliminate the RequireNonAbstractType hack I put in earlier, which was but a symptom of this larger problem. Fixes <rdar://problem/7806091>. llvm-svn: 99849
* Teach the diagnostic engine to provide more detailed information aboutDouglas Gregor2010-03-251-4/+14
| | | | | | | | | how to handle a diagnostic during template argument deduction, which may be "substitution failure", "suppress", or "report". This keeps us from, e.g., emitting warnings while performing template argument deduction. llvm-svn: 99560
* PS3 needs __PPC__. Should this be in the PPC target?John Thompson2010-03-251-0/+1
| | | | llvm-svn: 99513
* Fix a thinko and a typo in the delayed-diagnostic code.Douglas Gregor2010-03-221-3/+4
| | | | llvm-svn: 99178
* Introduce the notion of a single "delayed" diagnostic into theDouglas Gregor2010-03-222-3/+61
| | | | | | | | | | | | Diagnostic subsystem, which is used in the rare case where we find a serious problem (i.e., an inconsistency in the file system) while we're busy formatting another diagnostic. In this case, the delayed diagnostic will be emitted after we're done with the other diagnostic. This is only to be used for fatal conditions detected at very inconvenient times, where we can neither stop the current diagnostic in flight nor can we suppress the second error. llvm-svn: 99175
* Keep track of the size/modification time of each file source-locationDouglas Gregor2010-03-211-2/+1
| | | | | | | entry in a precompiled header, so that we can detect modified files even when we miss in the stat cache. llvm-svn: 99149
* Fix a longstanding (but previously unknown) bug in the lazyDouglas Gregor2010-03-191-1/+1
| | | | | | | | | | | | | deserialization of precompiled headers, where the deserialization of the source location entry for a buffer (e.g., macro instantiation scratch space) would overwrite a one-element FileID cache in the source manager. When tickled at the wrong time, we would return the wrong decomposed source location and eventually cause c-index-test to crash. Found by dumb luck. It's amazing this hasn't shown up before. llvm-svn: 98940
* Check the inode in addition to size and modification time to determineDouglas Gregor2010-03-171-3/+5
| | | | | | whether a file has changed since it was originally read. llvm-svn: 98726
* Use a simple diagnostic (file modified) when we detect that a file hasDouglas Gregor2010-03-171-10/+4
| | | | | | | changed, rather than trying to point out how it changed. The "why" doesn't matter. llvm-svn: 98725
* Teach SourceManager's content cache to keep track of whether itsDouglas Gregor2010-03-161-21/+24
| | | | | | | | | buffer was invalid when it was created, and use that bit to always set the "Invalid" flag according to whether the buffer is invalid. This ensures that all accesses to an invalid buffer are marked invalid, improving recovery. llvm-svn: 98690
* Update get*LineNumber() and get*ColumnNumber() functions to pass theDouglas Gregor2010-03-161-8/+8
| | | | | | | Invalid bit through; there are no safety-critical callers of these functions. llvm-svn: 98674
* Audit all callers of SourceManager::getCharacterData(); update some ofDouglas Gregor2010-03-161-2/+2
| | | | | | them to recover more gracefully on failure. llvm-svn: 98672
* Audit all getBuffer() callers (for both the FullSourceLoc andDouglas Gregor2010-03-162-11/+10
| | | | | | | SourceManager versions), updating those callers that need to recover gracefully from failure. llvm-svn: 98665
* Switch another function to StringRef instead of char pointer pairs.Benjamin Kramer2010-03-161-3/+2
| | | | llvm-svn: 98631
* Let SourceManager::getBufferData return StringRef instead of a pair of two ↵Benjamin Kramer2010-03-161-5/+3
| | | | | | const char*. llvm-svn: 98630
* Introduce optional "Invalid" parameters to routines that invoke theDouglas Gregor2010-03-161-25/+57
| | | | | | | | | | | | | SourceManager's getBuffer() and, therefore, could fail, along with Preprocessor::getSpelling(). Use the Invalid parameters in the literal parsers (string, floating point, integral, character) to make them robust against errors that stem from, e.g., PCH files that are not consistent with the underlying file system. I still need to audit every use caller to all of these routines, to determine which ones need specific handling of error conditions. llvm-svn: 98608
* Use SourceManager's Diagnostic object for all file-reading errors,Douglas Gregor2010-03-161-90/+33
| | | | | | simplifying the SourceManager interfaces somewhat. llvm-svn: 98598
* Give SourceManager a Diagnostic object with which to report errors,Douglas Gregor2010-03-161-13/+12
| | | | | | and start simplifying the interfaces in SourceManager that can fail. llvm-svn: 98594
* Add some <cstdio> includes to unbreak the buildbotsDouglas Gregor2010-03-151-0/+1
| | | | llvm-svn: 98591
* Introduce a new BufferResult class to act as the return type ofDouglas Gregor2010-03-151-11/+104
| | | | | | | | | | | | | | SourceManager's getBuffer() (and similar) operations. This abstract can be used to force callers to cope with errors in getBuffer(), such as missing files and changed files. Fix a bunch of callers to use the new interface. Add some very basic checks for file consistency (file size, modification time) into ContentCache::getBuffer(), although these checks don't help much until we've updated the main callers (e.g., SourceManager::getSpelling()). llvm-svn: 98585
OpenPOWER on IntegriCloud