summaryrefslogtreecommitdiffstats
path: root/clang/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* Split the single monolithic DiagnosticKinds.def file into oneChris Lattner2009-01-271-0/+1
| | | | | | | | | .def file for each library. This means that adding a diagnostic to sema doesn't require all the other libraries to be rebuilt. Patch by Anders Johnsen! llvm-svn: 63111
* Introduce a new PresumedLoc class to represent the concept of a locationChris Lattner2009-01-273-16/+20
| | | | | | | | | | | | | | | | | | | as reported to the user and as manipulated by #line. This is what __FILE__, __INCLUDE_LEVEL__, diagnostics and other things should follow (but not dependency generation!). This patch also includes several cleanups along the way: - SourceLocation now has a dump method, and several other places that did similar things now use it. - I cleaned up some code in AnalysisConsumer, but it should probably be simplified further now that NamedDecl is better. - TextDiagnosticPrinter is now simplified and cleaned up a bit. This patch is a prerequisite for #line, but does not actually provide any #line functionality. llvm-svn: 63098
* rename getFullFilePos -> getFileOffset.Chris Lattner2009-01-272-7/+7
| | | | llvm-svn: 63097
* PTH: Use Token::setLiteralData() to directly store a pointer to cached ↵Ted Kremenek2009-01-271-78/+45
| | | | | | | | | | spelling data in the PTH file. This removes a ton of code for looking up spellings using sourcelocations in the PTH file. This simplifies both PTH-generation and reading. Performance impact for -fsyntax-only on Cocoa.h (with Cocoa.h in the PTH file): - PTH generation time improves by 5% - PTH reading improves by 0.3%. llvm-svn: 63072
* Add version number checking to PTH files.Ted Kremenek2009-01-261-0/+1
| | | | llvm-svn: 63047
* Embed the offset of the PTH table inside the prologue of the PTH file. This ↵Ted Kremenek2009-01-261-0/+10
| | | | | | will help improve gradual versioning of PTH files instead of relying that the PTH table is at a fixed offset. llvm-svn: 63045
* minor speedups/cleanups for -E mode.Chris Lattner2009-01-261-8/+11
| | | | llvm-svn: 63029
* This change refactors some of the low-level lexer interfaces a bit.Chris Lattner2009-01-262-25/+14
| | | | | | | | | | | | | Token now has a class of kinds for "literals", which include numeric constants, strings, etc. These tokens can optionally have a pointer to the start of the token in the lexer buffer. This makes it faster to get spelling and do other gymnastics, because we don't have to go through source locations. This change is performance neutral, but will make other changes more feasible down the road. llvm-svn: 63028
* use simpler methodChris Lattner2009-01-251-1/+1
| | | | llvm-svn: 62974
* Added clang option '--analyzer-display-progress' to indicate that the ↵Ted Kremenek2009-01-233-12/+26
| | | | | | analyzer should output 'ANALYZE:' messages to display its progress on a source file. llvm-svn: 62875
* When using -analyzer-output-plist always output a plist file even if it ↵Ted Kremenek2009-01-234-6/+15
| | | | | | contains no error reports. llvm-svn: 62871
* Make -ast-dump print Objective-C method declarations (and otherDouglas Gregor2009-01-231-3/+3
| | | | | | Objective-C declarations!) again. Fixes <rdar://problem/6517155> llvm-svn: 62826
* Use NonFragileABI as name of new Next abi. More comments Fariborz Jahanian2009-01-221-3/+3
| | | | | | for the new meta-data. llvm-svn: 62806
* Adjust to api change.Chris Lattner2009-01-221-1/+1
| | | | llvm-svn: 62785
* Refactoring ObjC Next's runtime classes in preparation forFariborz Jahanian2009-01-211-0/+6
| | | | | | the new ObjC's abi. llvm-svn: 62721
* Add #line to make the Visual Studio compiler happy.Steve Naroff2009-01-211-1/+2
| | | | | | Fixes <rdar://problem/6507668> clang ObjC rewriter: put #line statement at top of rewritten file llvm-svn: 62706
* Don't turn off blocks when compiling Obj-C codeAnders Carlsson2009-01-211-1/+2
| | | | llvm-svn: 62701
* Add -analyze action to run static analyzer, instead of inferring fromDaniel Dunbar2009-01-201-5/+3
| | | | | | individual checker options. llvm-svn: 62634
* Remove ScopedDecl, collapsing all of its functionality into Decl, soDouglas Gregor2009-01-203-24/+24
| | | | | | | | | | | | | | | | that every declaration lives inside a DeclContext. Moved several things that don't have names but were ScopedDecls (and, therefore, NamedDecls) to inherit from Decl rather than NamedDecl, including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't store empty DeclarationNames for these things, nor do we try to insert them into DeclContext's lookup structure. The serialization tests are temporarily disabled. We'll re-enable them once we've sorted out the remaining ownership/serialiazation issues between DeclContexts and TranslationUnion, DeclGroups, etc. llvm-svn: 62562
* PTH: Emitted tokens now consist of 12 bytes that are loaded used 3 32-bit ↵Ted Kremenek2009-01-191-8/+10
| | | | | | loads. This reduces user time but increases system time because of the slightly larger PTH file. Although there is no performance win on Cocoa.h and -Eonly, overall this seems like a good step. llvm-svn: 62542
* Convert more expression actions to smart pointers.Sebastian Redl2009-01-191-23/+26
| | | | llvm-svn: 62537
* Convert more expression actions to smart pointers.Sebastian Redl2009-01-191-32/+30
| | | | | | Fix type of logical negation for C++. llvm-svn: 62475
* Convert a few expression actions to smart pointers.Sebastian Redl2009-01-181-23/+40
| | | | | | These actions are extremely widely used (identifier expressions and literals); still no performance regression. llvm-svn: 62468
* Convert ObjC statement actions to smart pointers.Sebastian Redl2009-01-181-22/+23
| | | | llvm-svn: 62465
* Convert asm statement action to smart pointers.Sebastian Redl2009-01-181-14/+13
| | | | llvm-svn: 62464
* Convert more statement actions to smart pointers.Sebastian Redl2009-01-181-16/+17
| | | | llvm-svn: 62463
* use simplified Lexer ctor.Chris Lattner2009-01-172-7/+2
| | | | llvm-svn: 62416
* add a simplified lexer ctor that sets up the lexer to raw-lex anChris Lattner2009-01-172-7/+2
| | | | | | entire file. llvm-svn: 62414
* this massive patch introduces a simple new abstraction: it makesChris Lattner2009-01-178-27/+27
| | | | | | | | | | | | | | | "FileID" a concept that is now enforced by the compiler's type checker instead of yet-another-random-unsigned floating around. This is an important distinction from the "FileID" currently tracked by SourceLocation. *That* FileID may refer to the start of a file or to a chunk within it. The new FileID *only* refers to the file (and its #include stack and eventually #line data), it cannot refer to a chunk. FileID is a completely opaque datatype to all clients, only SourceManager is allowed to poke and prod it. llvm-svn: 62407
* no need to check this: content cache is already 1-1 map with fileentries.Chris Lattner2009-01-171-2/+1
| | | | llvm-svn: 62402
* Instead of iterating over FileID's, have PTH generation iterate over theChris Lattner2009-01-171-14/+10
| | | | | | | content cache directly. Content cache has a 1-1 mapping with fileentries, whereas multiple FileIDs can be the same FileEntry. llvm-svn: 62401
* Convert some more statement actions to smart pointers.Sebastian Redl2009-01-161-16/+18
| | | | | | Fix a type error; parser wanted to pass the third part of a for-statement as a statement; should be expression. llvm-svn: 62380
* Make sure to escape " when it occurs in a string in pragma commentChris Lattner2009-01-161-1/+1
| | | | llvm-svn: 62367
* Make -E mode propagate #pragma comment's into the output.Chris Lattner2009-01-161-2/+31
| | | | llvm-svn: 62339
* more SourceLocation lexicon change: instead of referring to theChris Lattner2009-01-165-12/+12
| | | | | | "logical" location, refer to the "instantiation" location. llvm-svn: 62316
* Change some terminology in SourceLocation: instead of referring to Chris Lattner2009-01-161-5/+5
| | | | | | | the "physical" location of tokens, refer to the "spelling" location. This is more concrete and useful, tokens aren't really physical objects! llvm-svn: 62309
* IdentifierInfo:Ted Kremenek2009-01-152-15/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - IdentifierInfo can now (optionally) have its string data not be co-located with itself. This is for use with PTH. This aspect is a little gross, as getName() and getLength() now make assumptions about a possible alternate representation of IdentifierInfo. Perhaps we should make IdentifierInfo have virtual methods? IdentifierTable: - Added class "IdentifierInfoLookup" that can be used by IdentifierTable to perform "string -> IdentifierInfo" lookups using an auxilliary data structure. This is used by PTH. - Perform tests show that IdentifierTable::get() does not slow down because of the extra check for the IdentiferInfoLookup object (the regular StringMap lookup does enough work to mitigate the impact of an extra null pointer check). - The upshot is that now that some IdentifierInfo objects might be owned by the IdentiferInfoLookup object. This should be reviewed. PTH: - Modified PTHManager::GetIdentifierInfo to *not* insert entries in IdentifierTable's string map, and instead create IdentifierInfo objects on the fly when mapping from persistent IDs to IdentifierInfos. This saves a ton of work with string copies, hashing, and StringMap lookup and resizing. This change was motivated because when processing source files in the PTH cache we don't need to do any string -> IdentifierInfo lookups. - PTHManager now subclasses IdentifierInfoLookup, allowing clients of IdentifierTable to transparently use IdentifierInfo objects managed by the PTH file. PTHManager resolves "string -> IdentifierInfo" queries by doing a binary search over a sorted table of identifier strings in the PTH file (the exact algorithm we use can be changed as needed). These changes lead to the following performance changes when using PTH on Cocoa.h: - fsyntax-only: 10% performance improvement - Eonly: 30% performance improvement llvm-svn: 62273
* PTH: Embed a persistentID side-table in the PTH file that is sorted in theTed Kremenek2009-01-151-32/+43
| | | | | | | | lexical order of the corresponding identifier strings. This will be used for a forthcoming optimization. This slows down PTH generation time by 7%. We can revert this change if the optimization proves to not be valuable. llvm-svn: 62248
* Fix typo and spelling of -Wunused-macros.Daniel Dunbar2009-01-141-2/+2
| | | | llvm-svn: 62239
* DeclContext::KindTrait was not meant to be used outside of ↵Argyrios Kyrtzidis2009-01-131-2/+1
| | | | | | | | DeclContext::CastTo (causes compilation error on MSVC). Add DeclContext::getDeclKind() and use that instead of DeclContext::KindTrait. llvm-svn: 62164
* Print function parameters in DeclContextPrinter.Zhongxing Xu2009-01-131-0/+37
| | | | llvm-svn: 62153
* Improve c++ methods printing in DeclContextPrinter.Zhongxing Xu2009-01-131-16/+39
| | | | llvm-svn: 62143
* Improve DeclContextPrinter: print enum name.Zhongxing Xu2009-01-131-2/+8
| | | | llvm-svn: 62140
* Add an initial framework of a DeclContextPrinter. It can print DeclContext andZhongxing Xu2009-01-133-0/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | its Decls in indented format. An Example: $ cat t.cpp class A { int a; void f(); }; void A::f() { a = 3; } $ clang -print-decl-contexts t.cpp [translation unit] 0x9754d7c <typedef> __builtin_va_list [class] A 0x9753310 <class> A 0x975ce20 <field> a <c++ method> f <c++ ctor> A <c++ ctor> A <c++ method> operator= <c++ dtor> ~A [c++ method] f [[0x9753310]] Some comments: '<>' indicates a declaration, '[]' indicates a definition, '[[ ]]' displays the semantic DeclContext which is different from the lexical DeclContext. The symbols printed can definitely be changed in the future. llvm-svn: 62136
* Cleanup DeclContext::addDecl and DeclContext::insert interface, from Piotr RakDouglas Gregor2009-01-121-8/+4
| | | | llvm-svn: 62122
* Implement support for anonymous structs and unions in C. Both C andDouglas Gregor2009-01-121-3/+0
| | | | | | | | | | | | | | C++ handle anonymous structs/unions in the same way. Addresses several bugs: <rdar://problem/6259534> <rdar://problem/6481130> <rdar://problem/6483159> The test case in PR clang/1750 now passes with -fsyntax-only, but CodeGen for inline assembler still fails. llvm-svn: 62112
* make paste avoidance avoid pasting digraphs and :: only when digraphs or c++ ↵Chris Lattner2009-01-111-3/+6
| | | | | | | | is enabled respectively. Inspired by a patch by Dan Villiom Podlaski Christiansen. llvm-svn: 62044
* this patch "adds support for specifying multiple dependancy targets using ↵Chris Lattner2009-01-111-26/+43
| | | | | | | | ‘-MT’. Using this patch, I was able to use ‘ccc’ as C compiler for the few C files in LLVM. In my brief testing, the output remains identical to that of GCC." Patch by Dan Villiom Podlaski Christiansen! llvm-svn: 62040
* A few property related cleanups to ObjCContainerDecl AST.Steve Naroff2009-01-111-12/+10
| | | | llvm-svn: 62034
* Convert some more actions to smart pointers.Sebastian Redl2009-01-111-16/+19
| | | | | | | No performance regression in my basic test. Also fixed a type error in ActOnFinishSwitchStmt's arguments (body is a stmt). llvm-svn: 62032
OpenPOWER on IntegriCloud