summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove ATTRIBUTE_UNUSED from the common pattern of disallowing copying.Argyrios Kyrtzidis2010-08-151-3/+2
| | | | llvm-svn: 111101
* Extend the code-completion caching infrastructure to include globalDouglas Gregor2010-08-153-8/+100
| | | | | | | | | | | | | | | | | | declarations (in addition to macros). Each kind of declaration maps to a certain set of completion contexts, and the ASTUnit completion logic introduces the completion strings for those declarations if the actual code-completion occurs in one of the contexts where it matters. There are a few new code-completion-context kinds. Without these, certain completions (e.g., after "using namespace") would need to suppress all global completions, which would be unfortunate. Note that we don't get the priorities right for global completions, because we don't have enough type information. We'll need a way to compare types in an ASTContext-agnostic way before this can be implemented. llvm-svn: 111093
* Add ATTRIBUTE_UNUSED to methods not supposed to be used.Argyrios Kyrtzidis2010-08-151-2/+3
| | | | llvm-svn: 111087
* Implement caching of code-completion results for macro definitionsDouglas Gregor2010-08-131-8/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | when the CXTranslationUnit_CacheCompletionResults option is given to clang_parseTranslationUnit(). Essentially, we compute code-completion results for macro definitions after we have parsed the file, then store an ASTContext-agnostic version of those results (completion string, cursor kind, priority, and active contexts) in the ASTUnit. When performing code completion in that ASTUnit, we splice the macro definition results into the results provided by the actual code-completion (which has had macros turned off) before libclang gets those results. We use completion context information to only splice in those results that make sense for that context. With a completion involving all of the macros from Cocoa.h and a few other system libraries (totally ~8500 macro definitions) living in a precompiled header, we get about a 9% performance improvement from code completion, since we no longer have to deserialize all of the macro definitions from the precompiled header. Note that macro definitions are merely the canary; the cache is designed to also support other top-level declarations, which should be a bigger performance win. That optimization will be next. Note also that there is no mechanism for determining when to throw away the cache and recompute its contents. llvm-svn: 111051
* Change Sema's UnusedStaticFuncs to UnusedFileScopedDecls to allow also ↵Argyrios Kyrtzidis2010-08-132-27/+26
| | | | | | | | keeping track of unused file scoped variables. This is only preparation, currently only static function definitions are tracked, as before. llvm-svn: 111025
* Add a new cc1 option -fix-what-you-can which when combined with the fix-it modeNick Lewycky2010-08-131-0/+3
| | | | | | will apply all fixes even when there were other errors in the file. llvm-svn: 111020
* Implement clang_saveTranslationUnit(), which saves a translation unitDouglas Gregor2010-08-131-0/+23
| | | | | | into a PCH/AST file. llvm-svn: 111006
* Teach ASTUnit to hold on to the Sema object and ASTConsumer that areDouglas Gregor2010-08-133-11/+32
| | | | | | | | used when parsing (or re-parsing) a file. Also, when loading a precompiled header into ASTUnit, create a Sema object that holds onto semantic-analysis information. llvm-svn: 111003
* Zap unused UnaryOperator::OffsetOf.Eli Friedman2010-08-131-1/+0
| | | | llvm-svn: 110996
* The Sema object will get destroyed before all of the others anyway. We don't ↵Douglas Gregor2010-08-131-1/+0
| | | | | | need to force it llvm-svn: 110993
* Instead of modifying the ObjC AST to not modify existing declarations, teach ↵Sebastian Redl2010-08-134-15/+60
| | | | | | chained PCH to overwrite declarations from earlier PCH files in dependent ones. Tell Sema to note when it changes AST nodes so that they have to be reserialized. Finally, the ObjCProtocolDecls created in forward decls, like the ObjCInterfaceDecls in @class forward decls, are not lexically part of the decl context; only the definition is. llvm-svn: 110989
* Just disable the hidden-visibility optimization for now by hiding it behindJohn McCall2010-08-121-0/+1
| | | | | | | | a -cc1 option. The Darwin linker complains about mixed visibility when linking gcc-built objects with clang-built objects, and the optimization isn't really that valuable. Platforms with less ornery linkers can feel free to enable this. llvm-svn: 110979
* Teach CompilerInstance to create and hold on to the Sema object usedDouglas Gregor2010-08-122-6/+24
| | | | | | | for parsing, so that it can persist beyond the lifetime of the parsing call. llvm-svn: 110978
* Move Sema's headers into include/clang/Sema, renaming a few along the way.Douglas Gregor2010-08-122-3/+3
| | | | llvm-svn: 110945
* Added locations and type source info for DeclarationName inside UsingDecl.Abramo Bagnara2010-08-121-4/+6
| | | | llvm-svn: 110912
* Frontend: Move the bulk of the cc1_main() processing intoDaniel Dunbar2010-08-122-0/+155
| | | | | | ExecuteCompilerInvocation in libFrontend. llvm-svn: 110903
* Frontend: Add -target-linker-version, for specifying the version string of theDaniel Dunbar2010-08-111-1/+6
| | | | | | linker in use. llvm-svn: 110871
* -Make TokenID of IdentifierInfo read-only, remove setTokenID().Argyrios Kyrtzidis2010-08-112-1/+6
| | | | | | | | -There are 2 instances that change the TokenID for GNU libstdc++ 4.2 compatibility. To handler those cases introduce a RevertedTokenID bitfield, RevertTokenIDToIdentifier() and hasRevertedTokenIDToIdentifier() methods. Store the bitfield in PCH. llvm-svn: 110868
* Added locations and type source info for DeclarationName.Abramo Bagnara2010-08-114-2/+15
| | | | llvm-svn: 110860
* Reintroduce the ASTConsumer/ASTUnit fix from r110610, it has nothing to do ↵Sebastian Redl2010-08-112-2/+5
| | | | | | with the breakage. llvm-svn: 110840
* Fix a thinko in the creation of temporary files for the precompiled preambleDouglas Gregor2010-08-111-1/+2
| | | | llvm-svn: 110804
* Speculatively revert r110610 " Make ObjCInterfaceDecl redeclarable,Douglas Gregor2010-08-115-24/+14
| | | | | | | | and create separate decl nodes for forward declarations and the definition," which appears to be causing significant Objective-C breakage. llvm-svn: 110803
* Added TypeLocs to VAArgExpr node.Abramo Bagnara2010-08-102-0/+2
| | | | llvm-svn: 110666
* Added TypeLocs to TypesCompatibleExpr node.Abramo Bagnara2010-08-102-4/+4
| | | | llvm-svn: 110663
* - Make ObjCInterfaceDecl redeclarable, and create separate decl nodes for ↵Sebastian Redl2010-08-095-14/+24
| | | | | | | | | | forward declarations and the definition. - Eagerly create ObjCInterfaceTypes for declarations. - The two above changes lead to a 0.5% increase in memory use and no speed regression when parsing Cocoa.h. On the other hand, now chained PCH works when there's a forward declaration in one PCH and the interface definition in another. - Add HandleInterestingDecl to ASTConsumer. PCHReader passes the "interesting" decls it finds to this function instead of HandleTopLevelDecl. The default implementation forwards to HandleTopLevelDecl, but ASTUnit's handler for example ignores them. This fixes a potential crash when lazy loading of PCH data would cause ASTUnit's "top level" declaration collection to change while being iterated. llvm-svn: 110610
* Use precompiled preambles for in-process code completion.Douglas Gregor2010-08-091-12/+91
| | | | llvm-svn: 110596
* Complete PCH support for ObjCPropertyImplDecl.Argyrios Kyrtzidis2010-08-092-4/+8
| | | | llvm-svn: 110570
* Support ObjC implementation decls for PCH.Argyrios Kyrtzidis2010-08-092-5/+7
| | | | | | Strictly speaking, implementations don't go in headers but there's no law against it. llvm-svn: 110567
* Refactor into functions PCH reading/writing the CXXBaseOrMemberInitializers. ↵Argyrios Kyrtzidis2010-08-094-83/+98
| | | | | | No functionality change. llvm-svn: 110566
* Make -funroll-loops turn on loop unrolling in the optimizer insteadEric Christopher2010-08-071-3/+7
| | | | | | of just ignoring it. llvm-svn: 110525
* Push location through the MacroUndefined PPCallback and use it to print ↵Benjamin Kramer2010-08-071-0/+13
| | | | | | #undefs in -dD mode. (PR7818) llvm-svn: 110523
* Store inheritance paths after CastExprs instead of inside them.John McCall2010-08-072-15/+22
| | | | | | | | | | | | | | | This takes some trickery since CastExpr has subclasses (and indeed, is abstract). Also, smoosh the CastKind into the bitfield from Expr. Drops two words of storage from Expr in the common case of expressions which don't need inheritance paths. Avoids a separate allocation and another word of overhead in cases needing inheritance paths. Also has the advantage of not leaking memory, since destructors for AST nodes are never run. llvm-svn: 110507
* Removed IdempotentOperationChecker from default analysis and returned back ↵Tom Care2010-08-061-0/+3
| | | | | | | | | to a flag (-analyzer-check-idempotent-operations) - Added IdempotentOperationChecker to experimental analyses for testing purposes - Updated test cases to explictly call the checker llvm-svn: 110482
* Remove the DeclaredInCondition bit now that it's no longer used.Nick Lewycky2010-08-062-4/+0
| | | | llvm-svn: 110432
* Add an environment variable that makes libclang use chaining for PCH.Sebastian Redl2010-08-061-1/+3
| | | | llvm-svn: 110414
* Collect namespaces that need updating in a PCH chain. WIPSebastian Redl2010-08-051-0/+5
| | | | llvm-svn: 110378
* Write various C++-specific records to chained PCHs. Tests will come later.Sebastian Redl2010-08-052-22/+87
| | | | llvm-svn: 110357
* Store the pending implicit instantiations in the PCH and perform them at the ↵Argyrios Kyrtzidis2010-08-052-0/+35
| | | | | | | | end of the translation unit that included the PCH, as God intended. llvm-svn: 110324
* Support #pragma weak for PCH.Argyrios Kyrtzidis2010-08-052-0/+43
| | | | llvm-svn: 110323
* Make sure C++ variable definitions are actually passed to the consumer when ↵Argyrios Kyrtzidis2010-08-051-1/+2
| | | | | | loaded from PCH. llvm-svn: 110322
* Give clang_codeCompleteAt() an "options" parameter, and add a newDouglas Gregor2010-08-051-3/+11
| | | | | | | | | flags enumeration + default-generating function that allows code-completion to be customized via the libclang API. Plus, turn on spell-checking when performing code completion. llvm-svn: 110319
* Implement #pragma GCC visibility.Eli Friedman2010-08-052-1/+3
| | | | llvm-svn: 110315
* Activate selectors in chained PCH. Chained PCH now works for Objective-C.Sebastian Redl2010-08-041-1/+5
| | | | llvm-svn: 110262
* Bring stats for the method pool back.Sebastian Redl2010-08-042-11/+18
| | | | llvm-svn: 110247
* Implement per-file reading of the selector table. This disables statistics ↵Sebastian Redl2010-08-042-75/+83
| | | | | | about method pool hits for the moment. llvm-svn: 110245
* When chaining, only write interesting selectors to the PCH.Sebastian Redl2010-08-042-11/+47
| | | | llvm-svn: 110229
* Store the IDs of selectors in the PCH file explicitly.Sebastian Redl2010-08-042-33/+60
| | | | llvm-svn: 110219
* When performing in-process code completion, don't free the remappedDouglas Gregor2010-08-041-0/+1
| | | | | | | file buffers until the code completion results are destroyed; diagnostics may end up referring into the source. llvm-svn: 110216
* Add code-completion support directly to ASTUnit, which performs codeDouglas Gregor2010-08-042-33/+134
| | | | | | | | | | | | | | completion within the translation unit using the same command-line arguments for parsing the translation unit. Eventually, we'll reuse the precompiled preamble to improve code-completion performance, and this also gives us a place to cache results. Expose this function via the new libclang function clang_codeCompleteAt(), which performs the code completion within a CXTranslationUnit. The completion occurs in-process (clang_codeCompletion() runs code completion out-of-process). llvm-svn: 110210
* When we try (but fail) to build a precompiled preamble, wait for aDouglas Gregor2010-08-041-8/+31
| | | | | | | | | short "cooling off" period (defaulting to 5 reparses) before trying to build a precompiled preamble again. Previously, if we failed to build the precompiled preamble at any time, we just gave up the whole charade any never tried again. llvm-svn: 110187
OpenPOWER on IntegriCloud