summaryrefslogtreecommitdiffstats
path: root/clang/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* Always print out SourceManager stats with 'Stats' is true. This revealed ↵Ted Kremenek2009-01-091-2/+1
| | | | | | that PTH always pulls in the source pages with -fsyntax-only (investigating further). llvm-svn: 61996
* Provide a new kind of iterator, the specific_decl_iterator, thatDouglas Gregor2009-01-092-4/+4
| | | | | | | | | filters the decls seen by decl_iterator with two criteria: the dynamic type of the declaration and a run-time predicate described by a member function. This simplifies EnumDecl, RecordDecl, and ObjCContainerDecl considerably. It has no measurable performance impact. llvm-svn: 61994
* Move property API's up to ObjCContainerDecl (removing a lot of duplicate code).Steve Naroff2009-01-091-6/+6
| | | | | | | | | Add isa/cast/dyncast support for ObjCContainerDecl. Renamed classprop_iterator/begin/end to prop_iterator/begin/end (the class prefix was confusing). More simplifications to Sema::ActOnAtEnd()... Added/changed some FIXME's as a result of the above work. llvm-svn: 61988
* Don't crash when our FunctionDecl has a non-identifier nameDouglas Gregor2009-01-091-1/+2
| | | | llvm-svn: 61970
* Addressed the issue in <rdar://problem/6479085>, where we failed toDouglas Gregor2009-01-091-8/+6
| | | | | | | | | | | | | | | rewrite @class declarations that showed up within linkage specifications because those @class declarations never made it any place where the rewriter could find them. Moved all of the ObjC*Decl nodes over to ScopedDecls, so that they can live in the appropriate top-level or transparent DeclContext near the top level, e.g., TranslationUnitDecl or LinkageSpecDecl. Objective-C declarations now show up in a traversal of the declarations in a DeclContext (they didn't before!). This way, the rewriter finds all Objective-C declarations within linkage specifications. llvm-svn: 61966
* Enable support for '-x objective-c++-header'.Ted Kremenek2009-01-091-10/+24
| | | | llvm-svn: 61963
* Simpler solution to LiteralSupport compatibility: just add one whitespace ↵Ted Kremenek2009-01-091-27/+15
| | | | | | character after each cached string. llvm-svn: 61962
* PTH: For the cached spellings of literals, store one whitespace character ↵Ted Kremenek2009-01-081-12/+27
| | | | | | after the spelling to accomodate sanity checking in LiteralSuppoert.cpp. llvm-svn: 61956
* Place warning about 'readonly' property attributes whichFariborz Jahanian2009-01-081-0/+8
| | | | | | | are related to setter syntax under -Wreadonly-setter-attrs to prevent warnings in projects built with gcc. llvm-svn: 61953
* Remove redundant method context (now that ObjCMethodDecl isa ScopedDecl).Steve Naroff2009-01-081-1/+1
| | | | | | | | Convert clients to use the standard getDeclContext() API. Doug, thanks for the review! llvm-svn: 61935
* This is a large/messy diff that unifies the ObjC AST's with DeclContext.Steve Naroff2009-01-081-2/+1
| | | | | | | | | | | | | | | - ObjCContainerDecl's (ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl), ObjCCategoryImpl, & ObjCImplementation are all DeclContexts. - ObjCMethodDecl is now a ScopedDecl (so it can play nicely with DeclContext). - ObjCContainerDecl now does iteration/lookup using DeclContext infrastructure (no more linear search:-) - Removed ASTContext argument to DeclContext::lookup(). It wasn't being used and complicated it's use from an ObjC AST perspective. - Added Sema::ProcessPropertyDecl() and removed Sema::diagnosePropertySetterGetterMismatch(). - Simplified Sema::ActOnAtEnd() considerably. Still more work to do. - Fixed an incorrect casting assumption in Sema::getCurFunctionOrMethodDecl(), now that ObjCMethodDecl is a ScopedDecl. - Removed addPropertyMethods from ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl. This passes all the tests on my machine. Since many of the changes are central to the way ObjC finds it's methods, I expect some fallout (and there are still a handful of FIXME's). Nevertheless, this should be a step in the right direction. llvm-svn: 61929
* Remove debugging variable I forgot to remove in my last commit.Ted Kremenek2009-01-081-1/+0
| | | | llvm-svn: 61910
* Cache the "spellings" of string, character, and numeric literals in the PTHTed Kremenek2009-01-081-11/+106
| | | | | | file. For Cocoa.h, this enlarges the PTH file by 310K (4%). llvm-svn: 61909
* Refactor CacheTokens to use a PTHWriter class that creates and manages most ↵Ted Kremenek2009-01-081-96/+138
| | | | | | of the PTH generation data structures. No functionality change. llvm-svn: 61902
* Remove redunant (and incorrect) call to SourceManager::PrintStats(). This ↵Ted Kremenek2009-01-061-3/+0
| | | | | | would be called after a SourceManager was 'cleared', so it printed bogus results. Moreover, these stats are already printed earlier in the code path. llvm-svn: 61825
* use getBuffer() to fix compile error. Ted, please review.Chris Lattner2009-01-061-1/+1
| | | | llvm-svn: 61786
* Introduce support for "transparent" DeclContexts, which areDouglas Gregor2009-01-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | DeclContexts whose members are visible from enclosing DeclContexts up to (and including) the innermost enclosing non-transparent DeclContexts. Transparent DeclContexts unify the mechanism to be used for various language features, including C enumerations, anonymous unions, C++0x inline namespaces, and C++ linkage specifications. Please refer to the documentation in the Clang internals manual for more information. Only enumerations and linkage specifications currently use transparent DeclContexts. Still to do: use transparent DeclContexts to implement anonymous unions and GCC's anonymous structs extension, and, later, the C++0x features. We also need to tighten up the DeclContext/ScopedDecl link to ensure that every ScopedDecl is in a single DeclContext, which will ensure that we can then enforce ownership and reduce the memory footprint of DeclContext. llvm-svn: 61735
* Rename AddReadAttrs to FunctionAttrs. This is related to Duncan's patch r61525.Bill Wendling2008-12-311-1/+1
| | | | llvm-svn: 61534
* Convert a two more statement actions to smart pointers.Sebastian Redl2008-12-281-8/+11
| | | | llvm-svn: 61456
* Keep track of template arguments when we parse them. Right now, we don't ↵Douglas Gregor2008-12-241-1/+2
| | | | | | actually do anything with the template arguments, but they'll be used to create template declarations llvm-svn: 61413
* Fix <rdar://problem/6465284> clang ObjC rewriter: objc_super messed up again.Steve Naroff2008-12-231-16/+33
| | | | llvm-svn: 61384
* PTH: Use 3 bytes instead of 4 bytes to encode the persistent ID for a token.Ted Kremenek2008-12-231-1/+8
| | | | | | | - This reduces the PTH size for Cocoa.h by 7%. - The increases PTH -Eonly speed for Cocoa.h by 0.8%. llvm-svn: 61377
* PTH:Ted Kremenek2008-12-231-2/+8
| | | | | | | | - Encode the token length with 2 bytes instead of 4. - This reduces the size of the .pth file for Cocoa.h by 12%. - This speeds up PTH time (-Eonly) on Cocoa.h by 1.6%. llvm-svn: 61364
* PTH:Ted Kremenek2008-12-231-10/+44
| | | | | | | | | | | | - Embed 'eom' tokens in PTH file. - Use embedded 'eom' tokens to not lazily generate them in the PTHLexer. This means that PTHLexer can always advance to the next token after reading a token (instead of buffering tokens using a copy). - Moved logic of 'ReadToken' into Lex. GetToken & ReadToken no longer exist. - These changes result in a 3.3% speedup (-Eonly) on Cocoa.h. - The code is a little gross. Many cleanups are possible and should be done. llvm-svn: 61360
* Don't explicitly represent OverloadedFunctionDecls withinDouglas Gregor2008-12-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | DeclContext. Instead, just keep the list of currently-active declarations and only build the OverloadedFunctionDecl when we absolutely need it. This is a half-step toward eliminating the need to explicitly build OverloadedFunctionDecls that store sets of overloaded functions. This was suggested by Argiris a while back, and it's a good thing for several reasons: first, it eliminates the messy logic that currently tries to keep the OverloadedFunctionDecl in sync with the declarations that are being added. Second, it will (eventually) eliminate the need to allocate memory for overload sets, which could help performance. Finally, it helps set us up for when name lookup can return multiple (possibly ambiguous) results, as can happen with lookup of class members in C++. Next steps: make the IdentifierResolver store overloads as separate entries in its list rather than replacing them with an OverloadedFunctionDecl now, then see how far we can go toward eliminating OverloadedFunctionDecl entirely. llvm-svn: 61357
* Fix <rdar://problem/6463613> clang ObjC rewriter: assertion failure ↵Steve Naroff2008-12-221-0/+2
| | | | | | rewriting @selector?. llvm-svn: 61351
* Add an option to make 'RemoveDeadBindings' a configurable behavior. This enablesZhongxing Xu2008-12-221-3/+12
| | | | | | us to measure the effect of this optimization. llvm-svn: 61319
* Parser support for C++ try-catch.Sebastian Redl2008-12-211-1/+21
| | | | llvm-svn: 61312
* Convert a few Stmt actions to smart pointers.Sebastian Redl2008-12-211-13/+15
| | | | llvm-svn: 61309
* Remove rewriter dependency on 'nil' macro (used when rewriting for(...))Steve Naroff2008-12-171-2/+2
| | | | llvm-svn: 61135
* Make sure that enumerators show up within the enumeration declaration. ↵Douglas Gregor2008-12-171-0/+7
| | | | | | Fixes. PR clang/3220 llvm-svn: 61116
* Fix PrintParserCallbacks for the new ActOnLinkageSpec actionsDouglas Gregor2008-12-171-3/+16
| | | | llvm-svn: 61115
* Tweaks to allow us to rewrite with -x=objective-c++ enabled.Steve Naroff2008-12-171-0/+11
| | | | llvm-svn: 61113
* Make linkage-specifications hold on to all of their declarationsDouglas Gregor2008-12-161-3/+13
| | | | llvm-svn: 61110
* Fix crash with -ast-dump in C++.Eli Friedman2008-12-161-2/+3
| | | | llvm-svn: 61108
* Fix <rdar://problem/6445502> clang ObjC rewriter: _Block_release has wrong ↵Steve Naroff2008-12-161-11/+9
| | | | | | parameter type in preamble llvm-svn: 61088
* Some utilities for using the smart pointers in Actions, especially Sema. ↵Sebastian Redl2008-12-131-3/+3
| | | | | | Convert a few functions. llvm-svn: 60983
* Fix <rdar://problem/6435837> clang ObjC rewriter: use Block_release instead ↵Steve Naroff2008-12-121-2/+2
| | | | | | of Block_destroy. llvm-svn: 60962
* Force i[0-9]86 to i386 when using LLVM_HOSTTRIPLE.Daniel Dunbar2008-12-121-1/+8
| | | | | | | Only use major part of OS version when on darwin and modifying OS part of target triple. llvm-svn: 60957
* Enhance PTH preprocessor-condition-block side table to track ↵Ted Kremenek2008-12-121-16/+29
| | | | | | #elseinformation as well. llvm-svn: 60955
* PTH:Ted Kremenek2008-12-111-6/+55
| | | | | | | - Added a side-table per each token-cached file with the preprocessor conditional stack. This tracks what #if's are matched with what #endifs and where their respective tokens are in the PTH file. This will allow for quick skipping of excluded conditional branches in the Preprocessor. - Performance testing shows the addition of this information (without actually utilizing it) leads to no performance regressions. llvm-svn: 60911
* Rename a local predicate to avoid confusion with Type::isBlockPointerType().Steve Naroff2008-12-111-17/+17
| | | | llvm-svn: 60899
* Fixup generated code for imported block decl refs.Steve Naroff2008-12-111-4/+4
| | | | | | Found while investigating <rdar://problem/6435837> clang ObjC rewriter: use Block_release instead of Block_destroy. llvm-svn: 60898
* Fix <rdar://problem/6435842> clang ObjC rewriter: #include Block.h, ↵Steve Naroff2008-12-111-4/+0
| | | | | | Block_private.h or come up with #define to prevent double-definition llvm-svn: 60890
* Fix <rdar://problem/6435382> clang ObjC rewriter: @property/@synthesize and ↵Steve Naroff2008-12-111-8/+11
| | | | | | blocks don't work together llvm-svn: 60887
* Actually distinguish between RecordDecl::field_iterator and ↵Douglas Gregor2008-12-112-2/+2
| | | | | | RecordDecl::field_const_iterator, propagating the constness down to the FieldDecls. llvm-svn: 60883
* Unifies the name-lookup mechanisms used in various parts of the ASTDouglas Gregor2008-12-112-17/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and separates lexical name lookup from qualified name lookup. In particular: * Make DeclContext the central data structure for storing and looking up declarations within existing declarations, e.g., members of structs/unions/classes, enumerators in C++0x enums, members of C++ namespaces, and (later) members of Objective-C interfaces/implementations. DeclContext uses a lazily-constructed data structure optimized for fast lookup (array for small contexts, hash table for larger contexts). * Implement C++ qualified name lookup in terms of lookup into DeclContext. * Implement C++ unqualified name lookup in terms of qualified+unqualified name lookup (since unqualified lookup is not purely lexical in C++!) * Limit the use of the chains of declarations stored in IdentifierInfo to those names declared lexically. * Eliminate CXXFieldDecl, collapsing its behavior into FieldDecl. (FieldDecl is now a ScopedDecl). * Make RecordDecl into a DeclContext and eliminates its Members/NumMembers fields (since one can just iterate through the DeclContext to get the fields). llvm-svn: 60878
* Fix regression caused by fixing <rdar://problem/6429113> clang ObjC ↵Steve Naroff2008-12-101-1/+1
| | | | | | rewriter: crash rewriting file with Blocks and properties llvm-svn: 60839
* Fix <rdar://problem/6429113> clang ObjC rewriter: crash rewriting file with ↵Steve Naroff2008-12-091-6/+48
| | | | | | | | Blocks and properties More fancy footwork to cope with rewriting property 'setters'. llvm-svn: 60760
* Update Driver to new interface for LiveVariables.Ted Kremenek2008-12-091-1/+1
| | | | llvm-svn: 60732
OpenPOWER on IntegriCloud