aboutsummaryrefslogtreecommitdiff
path: root/Basic
AgeCommit message (Collapse)Author
2007-12-01Fixed bug in the serialization of SelectorTable where we did not register theTed Kremenek
pointer of MultiKeywordSelectors. Added optimization to the serialization of SelectorTable where we only serialize out MultiKeywordSelectors that are ever referenced by an object other than the SelectorTable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44483 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30start partitioning the diagnostics into two classes: thoseChris Lattner
that are builtin and those that are aren't. This is a bunch of API refactoring that will make this possible, but there is no functionality change yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44473 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30Implemented serialization of SelectorTable and Selectors.Ted Kremenek
Modified serialization of IdentifierTable to self-register itself with the Deserializer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44471 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27Add more semantic analysis for inline asm statements.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44349 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25Check that the clobber registers are valid.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44311 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-24Add tables for GCC register names and aliases. This will be used for inline asmAnders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44308 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15Break out bool/true/false support into a LangOptionNate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44164 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Renamed all serialization "Materialize" methods to "Create" to conform withTed Kremenek
the new serialization API. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44035 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-10Changed the serialization of IdentifierTable to only serialize out entriesTed Kremenek
that are referenced in the ASTs. This assumes that we serialize out the decls/stmts first, and use the pointer-tracking logic in the Serializer to determine if an IdentifierInfo (or its string key) is ever referenced. This is a significant space optimization for serialized ASTs. Consider the following program: void foo(int x,int y) { return x > y ? x : y+1; } Here are the sizes of the files for the serialized ASTs: Full IdentifierTable: 23676 bytes Only-referenced Identifiers: 304 bytes. For this simple program, this is a 77% reduction in the file size of the serialized ASTs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43975 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09rename getInstantiationLoc to match the scheme of isPhysicalLoc.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43969 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09change source location to have two bits for macros, trackingChris Lattner
whether the location is the start and/or end of an expansion. These are currently not set or used by anything. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43968 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09Changed method call to reflect updated serialization API.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43917 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-08Rewrote serialization of IdentifierInfo and IdentifierTable to use methods EmitTed Kremenek
and Materialize/Read instead of using specializations of SerializeTrait<>. The resulting code is much cleaner. We are also setting the stage so that only the parts of the IdentifierTable that are ever referenced within the ASTs are serialized, and not the whole table. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43904 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-05Added registration to deserialization engine of IdentifierInfo* asTed Kremenek
IdentifierInfos are deserialized. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43741 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01Simplified Serialization code for SourceLocation and SourceRange, andTed Kremenek
updated it to the recently updated Serialization API. Changed clients of SourceLocation serialization to call the appropriate new methods. Updated Decl serialization code to put new skeleton serialization code in place that is much better than the older trait-specialization approach. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43625 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31Updated a comment to hopefully silence a Lattner warning.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43562 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30Updated some comments.Ted Kremenek
Disabled assignments for ContentCache. Copy-ctor for ContentCache now has an assertion preventing it to be copied from an object that already has an allocated buffer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43526 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30Removed SrcMgr::FileInfo and SrcMgr::InfoRec and replaced them with aTed Kremenek
single class: ContentCache. This simplifies the logic in SourceManager and makes the ownership of MemoryBuffers clearer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43518 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25Implemented serialization of SourceLocation and SourceRange objects.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43343 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-24Modified current clients of Bitcode-Object serialization to use theTed Kremenek
new split-header file configuration (Serialize.h and Deserialize.h) now in place in the core LLVM repository. Removed unneeded SerializeTrait specializations for enums in TokenKinds.h git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43306 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-23Implemented serialization for IdentifierInfo and IdentifierTable.Ted Kremenek
Updated serialization test code in the driver to test serialization of these types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43266 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16Unbreak mingw32. Maybe there should be something like libClandSystem? :)Anton Korobeynikov
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43029 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-13Add __builtin_va_list definitions for x86_64 and ppc64.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42943 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11Push the rewriting APIs along. Build a trivial client that replaces tabsChris Lattner
with x's for now. The APIs are all unimplemented, so it doesn't do anything yet! :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42868 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10avoid accessing off the end of identifiers.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42841 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07move IdentifierTable.h from liblex to libbasic.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42730 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06speed up clang startup another 28% by avoiding std::vector<std::string> Chris Lattner
for holding builtin target-specific macros. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42689 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06speed up clang startup time by about 23% by avoiding lots of Chris Lattner
stringmap operations when there are no secondary targets. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42688 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-22work around bugs and missing features in apfloat.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42235 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-22Use APFloat for the representation of FP immediates, ask the targetChris Lattner
for *which* apfloat to use for a particular type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42234 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-12Removed clang solution file for VC++, which didn't work properly because of ↵Hartmut Kaiser
hard coded paths in the llvm project files. Changed windows detection to use LLVM pp constant. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41878 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-06remove the FATAL classifier.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41736 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-03VC++ doesn't define S_ISDIRChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41688 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-03Add #ifdefs to make the source portable to windows. Patch contributedChris Lattner
by Hartmut Kaiser! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41684 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-30constify a method.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41600 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02Fix a bug in my previous commitChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40719 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02Increase the macro id cache to look up several recent entries, not just the ↵Chris Lattner
last one. This is important in insane cases like the one dannyb sent me recently: #define F0(a) void a(){} #define F1(a) F0(a##0) F0(a##1) F0(a##2) F0(a##3) F0(a##4) F0(a##5) F0(a##6) F0(a##7) #define F2(a) F1(a##0) F1(a##1) F1(a##2) F1(a##3) F1(a##4) F1(a##5) F1(a##6) F1(a##7) #define F3(a) F2(a##0) F2(a##1) F2(a##2) F2(a##3) F2(a##4) F2(a##5) F2(a##6) F2(a##7) #define F4(a) F3(a##0) F3(a##1) F3(a##2) F3(a##3) F3(a##4) F3(a##5) F3(a##6) F3(a##7) #define F5(a) F4(a##0) F4(a##1) F4(a##2) F4(a##3) F4(a##4) F4(a##5) F4(a##6) F4(a##7) #define F6(a) F5(a##0) F5(a##1) F5(a##2) F5(a##3) F5(a##4) F5(a##5) F5(a##6) F5(a##7) F6(f) cpp is great. :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40715 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-24Use a smallstring instead of an std::string in FileChanged to avoid some ↵Chris Lattner
malloc traffic. This speeds up -E on xalancbmk by 2.4% git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40461 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-24check in an experiment that didn't work out, to allow for future investigation.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40460 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-24Add a cache to SourceManager to accellerate line # lookup. This is aChris Lattner
bottleneck for -E computation, because every token that starts a line needs to determine *which* line it is on (so -E mode can insert the appropriate vertical whitespace). This optimization improves this common case where it is striding through the line # table. This speeds up -E on xalancbmk by 3.2% git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40459 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-22Switch TargetInfo::getTargetDefines from using an std::map<std::string, ...> ↵Chris Lattner
to using a llvm::StringMap. This dramatically reduces the startup time of the preprocessor, speeding up -Eonly on xalankbmk by 2.2%. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40396 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-21Add support for reusing macroid's with negative physical loc deltas. ThisChris Lattner
keeps the MacroInfo table more compact. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40281 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-20remove some old cruftChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40111 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-20improve comments, implement a trivial single-entry cache in Chris Lattner
SourceManager::getInstantiationLoc. With this change, every token expanded from a macro doesn't get its own MacroID. :) This reduces # macro IDs in carbon.h from 16805 to 9197 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40108 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-20Reimplement SourceLocation. Instead of having a Chris Lattner
fileid/offset pair, it now contains a bit discriminating between mapped locations and file locations. This separates the tables for macros and files in SourceManager, and allows better separation of concepts in the rest of the compiler. This allows us to have *many* macro instantiations before running out of 'addressing space'. This is also more efficient, because testing whether something is a macro expansion is now a bit test instead of a table lookup (which also used to require having a srcmgr around, now it doesn't). This is fully functional, but there are several refinements and optimizations left. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40103 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-16Make octal constant lexing use AdvanceToTokenCharacter to give moreChris Lattner
accurate diagnostics. For test/Lexer/comments.c we now emit: int x = 000000080; /* expected-error {{invalid digit}} */ ^ constants.c:7:4: error: invalid digit '8' in octal constant 00080; /* expected-error {{invalid digit}} */ ^ The last line is due to an escaped newline. The full line looks like: int y = 0000\ 00080; /* expected-error {{invalid digit}} */ Previously, we emitted: constants.c:4:9: error: invalid digit '8' in octal constant int x = 000000080; /* expected-error {{invalid digit}} */ ^ constants.c:6:9: error: invalid digit '8' in octal constant int y = 0000\ ^ which isn't too bad, but the new way is better for the user, regardless of whether there is an escaped newline or not. All the other lexer-related diagnostics should switch over to using AdvanceToTokenCharacter where appropriate. Help wanted :). This implements test/Lexer/constants.c. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39906 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-15Change SourceManager::getInstantiationLoc to take virtual locations, doing itsChris Lattner
virtual->physical mapping explicitly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39867 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-14A significant refactoring of the type size stuff to also Chris Lattner
compute type alignment. This info is needed for struct layout. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39850 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-12add missing headerGabor Greif
(needed on Solaris) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39781 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-11Stage two of getting CFE top correct.Reid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39734 91177308-0d34-0410-b5e6-96231b3b80d8