summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
* Implement method type encoding in the presenseFariborz Jahanian2010-04-082-0/+2
| | | | | | of c-style arguments. Completes radar 7445205. llvm-svn: 100813
* Make CXXScopeSpec invalid when incomplete, and propagate that into anyJeffrey Yasskin2010-04-081-1/+1
| | | | | | | Declarator that depends on it. This fixes several redundant errors and bad recoveries. llvm-svn: 100779
* Fronted: Kill overly specialized RecordLayoutDumper, just make ↵Daniel Dunbar2010-04-083-40/+1
| | | | | | -dump-record-layouts a bit that Sema honors. llvm-svn: 100747
* AST: Move C++ record layout dumping to ASTContext::DumpRecordLayout.Daniel Dunbar2010-04-081-121/+8
| | | | llvm-svn: 100746
* refactor out a function.Chris Lattner2010-04-081-24/+29
| | | | llvm-svn: 100733
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-074-11/+11
| | | | llvm-svn: 100708
* add clang -cc1 level support for "-ferror-limit 42"Chris Lattner2010-04-072-0/+9
| | | | llvm-svn: 100687
* Instead of counting totally diagnostics, split the count into a countChris Lattner2010-04-071-5/+13
| | | | | | | | | | | | | | | 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
* teach clang to install the inline asm diagnostic handler,Chris Lattner2010-04-061-2/+74
| | | | | | | | | | | | | | | | | allowing backend errors to be mapped through clang's diagnostics subsystem, including the backend location info. We now get: $ clang asm.c -c -o t.o -integrated-as <inline asm>:1:2: error: unrecognized instruction abc incl %eax ^ 1 diagnostic generated. With colors, and correct "# diagnostics generated". llvm-svn: 100543
* reduce indentation, tidy.Chris Lattner2010-04-061-114/+121
| | | | llvm-svn: 100537
* Make code-completion for Objective-C message sends to "id" work in theDouglas Gregor2010-04-061-0/+8
| | | | | | | | presence of precompiled headers by forcibly loading all of the methods we know about from the PCH file before constructing our code-completion list. llvm-svn: 100535
* Make Diagnostic reference-counted, which is simpler than jugglingDouglas Gregor2010-04-054-28/+24
| | | | | | maybe-ownership vs. ownership. llvm-svn: 100498
* Match MemoryBuffer API changes.Chris Lattner2010-04-052-4/+3
| | | | llvm-svn: 100484
* Clarify the ownership semantics of the Diagnostic object used byDouglas Gregor2010-04-053-25/+56
| | | | | | | | | ASTUnit. Previously, we would end up with use-after-free errors because the Diagnostic object would be creating in one place (say, CIndex) and its ownership would not be transferred into the ASTUnit. Fixes <rdar://problem/7818608>. llvm-svn: 100464
* Minor ASTUnit cleanups:Douglas Gregor2010-04-051-3/+5
| | | | | | | | - Rename "Diagnostics" and related to "StoredDiagnostics", to better capture what we're actually storing. - Move SourceManager and FileManager to the heap. llvm-svn: 100441
* Driver: Add support for a CLANGXX_IS_PRODUCTION build variable, which enableDaniel Dunbar2010-04-011-1/+1
| | | | | | Clang++ support, even in "Production" mode (for testing purposes). llvm-svn: 100119
* Reinstate my CodeModificationHint -> FixItHint renaming patch, withoutDouglas Gregor2010-03-313-16/+15
| | | | | | the C-only "optimization". llvm-svn: 100022
* Rename TypenameType to DependentNameType in anticipation of someDouglas Gregor2010-03-312-2/+2
| | | | | | refactoring work in this area. llvm-svn: 100019
* Revert r100008, which inexplicably breaks the clang-i686-darwin10 builderDouglas Gregor2010-03-313-15/+16
| | | | llvm-svn: 100018
* Rename CodeModificationHint to FixItHint, since we've been using theDouglas Gregor2010-03-313-16/+15
| | | | | | | term "fix-it" everywhere and even *I* get tired of long names sometimes. No functionality change. llvm-svn: 100008
* Remember the regparm attribute in FunctionType::ExtInfo.Rafael Espindola2010-03-302-5/+8
| | | | | | Fixes PR3782. llvm-svn: 99940
* the big refactoring bits of PR3782.Rafael Espindola2010-03-303-31/+32
| | | | | | | | This introduces FunctionType::ExtInfo to hold the calling convention and the noreturn attribute. The next patch will extend it to include the regparm attribute and fix the bug. llvm-svn: 99920
* Teach Clang's -cc1 option -print-stats to print LLVM statistics.Douglas Gregor2010-03-301-0/+4
| | | | llvm-svn: 99894
* Implement support for -nostdc++. Fixes PR6446.Douglas Gregor2010-03-242-4/+10
| | | | llvm-svn: 99417
* PPCallbacks: Add hook for reaching the end of the main file, and fix ↵Daniel Dunbar2010-03-232-4/+9
| | | | | | DependencyFile to not do work in its destructor. llvm-svn: 99257
* Keep track of the size/modification time of each file source-locationDouglas Gregor2010-03-212-5/+19
| | | | | | | entry in a precompiled header, so that we can detect modified files even when we miss in the stat cache. llvm-svn: 99149
* C++: Add support for -fno-use-cxa-atexit.Daniel Dunbar2010-03-201-3/+6
| | | | | | | | - So much typing, so little gain... Also, rename the __cxx_global_initialization function just to match llvm-gcc. llvm-svn: 99039
* Remove the capture, serialization, and deserialization of commentDouglas Gregor2010-03-192-33/+2
| | | | | | | | ranges as part of the ASTContext. This code is not and was never used, but contributes ~250k to the size of the Cocoa.h precompiled header. llvm-svn: 99007
* Implement serialization and lazy deserialization of the preprocessingDouglas Gregor2010-03-192-8/+206
| | | | | | | | | | | | | | | | | | | | | | | | record (which includes all macro instantiations and definitions). As with all lay deserialization, this introduces a new external source (here, an external preprocessing record source) that loads all of the preprocessed entities prior to iterating over the entities. The preprocessing record is an optional part of the precompiled header that is disabled by default (enabled with -detailed-preprocessing-record). When the preprocessor given to the PCH writer has a preprocessing record, that record is written into the PCH file. When the PCH reader is given a PCH file that contains a preprocessing record, it will be lazily loaded (which, effectively, implicitly adds -detailed-preprocessing-record). This is the first case where we have sections of the precompiled header that are added/removed based on a compilation flag, which is unfortunate. However, this data consumes ~550k in the PCH file for Cocoa.h (out of ~9.9MB), and there is a non-trivial cost to gathering this detailed preprocessing information, so it's too expensive to turn on by default. In the future, we should investigate a better encoding of this information. llvm-svn: 99002
* clang -cc1: Kill off -empty-input only, and replace with -init-only which is anDaniel Dunbar2010-03-193-9/+16
| | | | | | | | actual action. - This is easier to use, and more reliable for timing the thing this was actually meant to be useful for. llvm-svn: 98978
* Optionally store a PreprocessingRecord in the preprocessor itself, andDouglas Gregor2010-03-193-16/+9
| | | | | | tie its creation to a CC1 flag -detailed-preprocessing-record. llvm-svn: 98963
* Add bounds check in PCHReader. when reading source file entry recordTed Kremenek2010-03-181-0/+5
| | | | llvm-svn: 98873
* Introduce the notion of a "preprocessing record", which keeps track ofDouglas Gregor2010-03-181-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | the macro definitions and macro instantiations that are found during preprocessing. Preprocessing records are *not* generated by default; rather, we provide a PPCallbacks subclass that hooks into the existing callback mechanism to record this activity. The only client of preprocessing records is CIndex, which keeps track of macro definitions and instantations so that they can be exposed via cursors. At present, only token annotation uses these facilities, and only for macro instantiations; both will change in the near future. However, with this change, token annotation properly annotates macro instantiations that do not produce any tokens and instantiations of macros that are later undef'd, improving our consistency. Preprocessing directives that are not macro definitions are still handled by clang_annotateTokens() via re-lexing, so that we don't have to track every preprocessing directive in the preprocessing record. Performance impact of preprocessing records is still TBD, although it is limited to CIndex and therefore out of the path of the main compiler. llvm-svn: 98836
* Make some typedefs privateKovarththanan Rajaratnam2010-03-181-2/+3
| | | | llvm-svn: 98817
* Rename variable to indicate what it is being used forKovarththanan Rajaratnam2010-03-181-4/+4
| | | | llvm-svn: 98816
* Turn several PCH reader assertions into compiler errors, thus makingTed Kremenek2010-03-181-30/+94
| | | | | | the PCHReader more robust to corrupt or invalid PCH files. llvm-svn: 98788
* Entering the main source file in the preprocessor can fail if theDouglas Gregor2010-03-174-8/+16
| | | | | | source file has been changed. Handle that failure more gracefully. llvm-svn: 98727
* Simplify error path using OwningPtrKovarththanan Rajaratnam2010-03-171-4/+3
| | | | llvm-svn: 98722
* Simplify ProcessWarningOptions since it can't failKovarththanan Rajaratnam2010-03-172-5/+2
| | | | llvm-svn: 98721
* Issue a proper diagnostic if we couldn't open dump fileKovarththanan Rajaratnam2010-03-171-7/+6
| | | | llvm-svn: 98719
* Don't "take" the file manager and source manager whenDouglas Gregor2010-03-171-2/+0
| | | | | | | ASTUnit::LoadFromCompilerInvocation() fails to create target information. llvm-svn: 98697
* Make sure we actually override ReadHeaderFileInfo when we meant toDouglas Gregor2010-03-161-1/+1
| | | | llvm-svn: 98655
* Fix header-search problems with precompiled headers, where theDouglas Gregor2010-03-162-28/+27
| | | | | | | | | | | | | | | | | | | | | | presence or absence of header map arguments when using the precompiled header would cause Clang to get confused about which headers had already been included/imported, along with their controlling macros. The fundamental problem is that the serialization of the header search information was relying on the UIDs of FileEntry objects at PCH generation time and PCH load time to be equivalent, which effectively means that we had to probe the same files in the same order. Differing header map arguments caused an extra FileEntry lookup, but it's easy to imagine other minor command-line arguments triggering this problem. Header-search information is now encoded along with the source-location entry for a file, so that we register information about a file's properties as a header at the same time we create the FileEntry for that file. Fixes <rdar://problem/7743243>. llvm-svn: 98636
* Switch another function to StringRef instead of char pointer pairs.Benjamin Kramer2010-03-161-4/+4
| | | | llvm-svn: 98631
* Let SourceManager::getBufferData return StringRef instead of a pair of two ↵Benjamin Kramer2010-03-162-12/+8
| | | | | | const char*. llvm-svn: 98630
* Don't consume tokens past the end-of-file in an @interface. FixesDouglas Gregor2010-03-161-0/+2
| | | | | | <rdar://problem/7735566>. llvm-svn: 98613
* Use SourceManager's Diagnostic object for all file-reading errors,Douglas Gregor2010-03-162-2/+3
| | | | | | simplifying the SourceManager interfaces somewhat. llvm-svn: 98598
* Give SourceManager a Diagnostic object with which to report errors,Douglas Gregor2010-03-164-26/+14
| | | | | | and start simplifying the interfaces in SourceManager that can fail. llvm-svn: 98594
* Introduce a new BufferResult class to act as the return type ofDouglas Gregor2010-03-152-5/+22
| | | | | | | | | | | | | | 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
* Add support for -Wwrite-strings. Patch by Mike M! Fixes PR 4804.John McCall2010-03-151-0/+3
| | | | llvm-svn: 98541
OpenPOWER on IntegriCloud