summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHReader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Match MemoryBuffer API changes.Chris Lattner2010-04-051-3/+2
| | | | llvm-svn: 100484
* Rename TypenameType to DependentNameType in anticipation of someDouglas Gregor2010-03-311-1/+1
| | | | | | refactoring work in this area. llvm-svn: 100019
* Remember the regparm attribute in FunctionType::ExtInfo.Rafael Espindola2010-03-301-5/+7
| | | | | | Fixes PR3782. llvm-svn: 99940
* the big refactoring bits of PR3782.Rafael Espindola2010-03-301-3/+4
| | | | | | | | 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
* Keep track of the size/modification time of each file source-locationDouglas Gregor2010-03-211-5/+12
| | | | | | | entry in a precompiled header, so that we can detect modified files even when we miss in the stat cache. llvm-svn: 99149
* Remove the capture, serialization, and deserialization of commentDouglas Gregor2010-03-191-13/+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-191-5/+120
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Add bounds check in PCHReader. when reading source file entry recordTed Kremenek2010-03-181-0/+5
| | | | llvm-svn: 98873
* 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
* Fix header-search problems with precompiled headers, where theDouglas Gregor2010-03-161-13/+12
| | | | | | | | | | | | | | | | | | | | | | 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
* Add IdentifierTable::get() overload and start using itKovarththanan Rajaratnam2010-03-121-1/+1
| | | | llvm-svn: 98343
* Create a new InjectedClassNameType to represent bare-word references to the John McCall2010-03-101-0/+9
| | | | | | | | | | | | | injected class name of a class template or class template partial specialization. This is a non-canonical type; the canonical type is still a template specialization type. This becomes the TypeForDecl of the pattern declaration, which cleans up some amount of code (and complicates some other parts, but whatever). Fixes PR6326 and probably a few others, primarily by re-establishing a few invariants about TypeLoc sizes. llvm-svn: 98134
* Undefine correct macroKovarththanan Rajaratnam2010-03-071-14/+14
| | | | llvm-svn: 97920
* Fix bug I introduced with assinging a temporary to a StringRef.Ted Kremenek2010-02-121-2/+2
| | | | llvm-svn: 96041
* Implementing unused function warning.Tanya Lattner2010-02-121-0/+15
| | | | llvm-svn: 95940
* Allocate 'ObjCMethodList' objects (owned by Sema) using Sema's ↵Ted Kremenek2010-02-111-2/+6
| | | | | | BumpPtrAllocator. Previously they were not getting freed. Fixes <rdar://problem/7635663>. llvm-svn: 95834
* clang -cc1: Add -fsjlj-exceptions, which requires far too much button pushing.Daniel Dunbar2010-02-101-0/+2
| | | | llvm-svn: 95785
* Implement synthesizing properties by default.Fariborz Jahanian2010-02-091-0/+2
| | | | | | | | | This is a non-fragile-abi feature only. Since it breaks existing code, it is currently placed under -fobjc-nonfragile-abi2 option for test purposes only until further notice. WIP. llvm-svn: 95685
* First stage of adding AltiVec supportJohn Thompson2010-02-051-3/+5
| | | | llvm-svn: 95335
* Add VarDecl::isThisDeclarationADefinition(), which properly encapsulates the ↵Sebastian Redl2010-01-311-3/+2
| | | | | | logic for when a variable declaration is a (possibly tentativ) definition. Add a few functions building on this, and shift C tentative definition handling over to this new functionality. This shift also kills the Sema::TentativeDefinitions map and instead simply stores all declarations in the renamed list. The correct handling for multiple tentative definitions is instead shifted to the final walk of the list. llvm-svn: 94968
* (1) Rename getClangSubversionRevision() to getClangRevision(), andTed Kremenek2010-01-221-8/+1
| | | | | | | | | | | | | | | | | have it return a StringRef instead of an integer (to be more VCS agnostic). (2) Add getClangFullRepositoryVersion(), which contains an amalgamation of the repository name and the revision. (3) Change PCH to only emit the string returned by getClangFullRepositoryVersion() instead of also emitting the value of getClangSubversionRevision() (which has been removed). This is functionally equivalent. More cleanup to version string generation pending... llvm-svn: 94231
* Rename pch::SVN_BRANCH_REVISION to pch::VERSION_CONTROL_BRANCH_REVISION.Ted Kremenek2010-01-221-1/+1
| | | | llvm-svn: 94214
* Rename getClangSubversionPath() -> getClangRepositoryPath() and have it ↵Ted Kremenek2010-01-221-3/+3
| | | | | | return a StringRef. llvm-svn: 94213
* Improve source-location information for builtin TypeLocs, from EneaDouglas Gregor2010-01-181-1/+7
| | | | | | Zaffanella (with a couple of my tweaks). llvm-svn: 93733
* Encoding calling conventions in the type system, from Charles Davis!Douglas Gregor2010-01-181-4/+6
| | | | llvm-svn: 93726
* Add type source information for both kinds of typeof types.John McCall2010-01-131-2/+7
| | | | | | Patch by Enea Zaffanella. llvm-svn: 93344
* Teach Preprocessor::macro_begin/macro_end to lazily load all macroDouglas Gregor2010-01-041-1/+61
| | | | | | | | definitions from a precompiled header. This ensures that code-completion with macro names behaves the same with or without precompiled headers. llvm-svn: 92497
* Get rid of FixedWidthIntType, as suggested by Chris and Eli.Anders Carlsson2009-12-291-8/+0
| | | | llvm-svn: 92246
* Serialize the NoReturn bit on FunctionTypes for precompiled headersDouglas Gregor2009-12-221-4/+5
| | | | llvm-svn: 91911
* Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gaveJeffrey Yasskin2009-12-121-1/+1
| | | | | | no extra safety anyway. llvm-svn: 91207
* Implement runtime checks for undefined behavior. WIP.Mike Stump2009-12-121-0/+3
| | | | | | | | | | | | | This implements a new flag -fcatch-undefined-behavior. The flag turns on additional runtime checks for: T a[I]; a[i] abort when i < 0 or i >= I. Future stuff includes shifts by >= bitwidth amounts. llvm-svn: 91198
* DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated ↵John McCall2009-12-071-5/+5
| | | | | | | | | | | | | | | | | | | | | variables, but the results are imperfect. For posterity, I did: cat <<EOF > $cmdfile s/DeclaratorInfo/TypeSourceInfo/g s/DInfo/TInfo/g s/TypeTypeSourceInfo/TypeSourceInfo/g s/SourceTypeSourceInfo/TypeSourceInfo/g EOF find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \; find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \; find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \; llvm-svn: 90743
* Fix "using typename" and the instantiation of non-dependent using declarations.John McCall2009-12-041-0/+7
| | | | llvm-svn: 90614
* Switch PCHReader::getOriginalSourceFile to use proper diagnostics.Daniel Dunbar2009-12-031-8/+7
| | | | llvm-svn: 90434
* Add DeclarationName support for C++0x operator literals. They should now work asAlexis Hunt2009-11-291-0/+4
| | | | | | | function names outside of templates - they'll probably cause some damage there as they're largely untested. llvm-svn: 90064
* Remove VISIBILITY_HIDDEN from anonymous namespaces in libFrontend.Benjamin Kramer2009-11-281-6/+5
| | | | llvm-svn: 90033
* Allow user re-definition of SEL as well as accessing its fields.Fariborz Jahanian2009-11-251-1/+1
| | | | | | This fixes pr5611. llvm-svn: 89895
* This patch implements objective-c's 'SEL' type as a built-inFariborz Jahanian2009-11-211-0/+7
| | | | | | | | | | | | | | | | | | type and fixes a long-standing code gen. crash reported in at least two PRs and a radar. (radar 7405040 and pr5025). There are couple of remaining issues that I would like for Ted. and Doug to look at: Ted, please look at failure in Analysis/MissingDealloc.m. I have temporarily added an expected-warning to make the test pass. This tests has a declaration of 'SEL' type which may not co-exist with the new changes. Doug, please look at a FIXME in PCHWriter.cpp/PCHReader.cpp. I think the changes which I have ifdef'ed out are correct. They need be considered for in a few Indexer/PCH test cases. llvm-svn: 89561
* Use llvm::sys::Path to check isAbsolute, instead of hard coding. Also, ↵Daniel Dunbar2009-11-181-3/+2
| | | | | | remove random FIXME (?). llvm-svn: 89229
* Remove local splitLines reimplementation.Daniel Dunbar2009-11-131-29/+7
| | | | llvm-svn: 88661
* Tweak PCH -include handling to make sure it matches the name as would be presentDaniel Dunbar2009-11-111-4/+6
| | | | | | in the predefines buffer. llvm-svn: 86903
* Redo how PCH handles its implicit include. Instead of treating this specially inDaniel Dunbar2009-11-111-4/+23
| | | | | | | | | | | | | | | the front-end (as far as the preprocessor goes), follow the usual logic of inserting the (original include path) name into the predefines buffer. This pushes the responsibility for handling this to PCH instead of the front-end. In PCH this requires being a little more clever when we diff the predefines buffers. Neither of these solutions are particularly great, I think what we eventually should do is something like gcc where we insert a special marker to indicate the PCH file, but then run the preprocessor as usual. This would be clearer and would allow us to drop the overly clever predefines handling. llvm-svn: 86806
* More StringRef simplification to PCHValidator::ReadPredefinesBuffer.Daniel Dunbar2009-11-111-27/+22
| | | | llvm-svn: 86805
* Rewrite splitLines using StringRef; this is much simpler, and also now avoidsDaniel Dunbar2009-11-111-26/+26
| | | | | | | | | | | | | tons of std::string trashing. I plan to move this and other fun string munging utilities to a StringRefExtras.h at some point if no one beats me to it. On a synthetic benchmark on x86_64, llvm-gcc actually generates code thats 10% faster using the StringRef version. gcc miscompiles the synthetic benchmark, which I'm crossing my fingers and hoping won't happen here. clang compiles the sythetic benchmark correctly (wootness), but the StringRef version is slower. Silly clang. llvm-svn: 86799
* Introduce a new representation for template templateDouglas Gregor2009-11-111-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | parameters. Rather than storing them as either declarations (for the non-dependent case) or expressions (for the dependent case), we now (always) store them as TemplateNames. The primary change here is to add a new kind of TemplateArgument, which stores a TemplateName. However, making that change ripples to every switch on a TemplateArgument's kind, also affecting TemplateArgumentLocInfo/TemplateArgumentLoc, default template arguments for template template parameters, type-checking of template template arguments, etc. This change is light on testing. It should fix several pre-existing problems with template template parameters, such as: - the inability to use dependent template names as template template arguments - template template parameter default arguments cannot be instantiation However, there are enough pieces missing that more implementation is required before we can adequately test template template parameters. llvm-svn: 86777
* StringRefify some PCH interfaces.Daniel Dunbar2009-11-111-28/+22
| | | | llvm-svn: 86775
* Replace startsWith functions with StringRef.Daniel Dunbar2009-11-111-25/+4
| | | | llvm-svn: 86774
* Switch to getFileOrSTDIN().Daniel Dunbar2009-11-101-4/+1
| | | | llvm-svn: 86632
* Adding -fshort-wchar option.John Thompson2009-11-051-0/+2
| | | | llvm-svn: 86167
OpenPOWER on IntegriCloud