summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* Incomplete promotion of selector info to per-file data.Sebastian Redl2010-08-032-52/+40
| | | | | | Store all selectors in the selector hash table instead of only those from the method pool. llvm-svn: 110158
* When using a precompiled preamble, keep track of the top-levelDouglas Gregor2010-08-031-7/+47
| | | | | | | | | | declarations that we saw when creating the precompiled preamble, and provide those declarations in addition to the declarations parsed in the main source file when traversing top-level declarations. This makes the use of precompiled preambles a pure optimization, rather than changing the semantics of the parsed translation unit. llvm-svn: 110131
* PR7795: Fix the definition of __WCHAR_MAX__ with -fshort-wchar.Eli Friedman2010-08-031-1/+1
| | | | llvm-svn: 110126
* Apart from storing/retrieving the previous redeclaration from PCH, also ↵Argyrios Kyrtzidis2010-08-034-18/+144
| | | | | | | | | | | | store/retrieve the most recent redeclaration. That way we are sure that the full redeclarations chain is loaded. When using chained PCHs, first declarations point to the most recent redeclarations in the same PCH. To address this use a REDECLS_UPDATE_LATEST record block to keep track of which first declarations need to point to a most recent redeclaration in another PCH. llvm-svn: 110125
* Send AST dumping/printing to stdout instead of stderr.Argyrios Kyrtzidis2010-08-031-1/+1
| | | | llvm-svn: 110123
* Avoid writing a VTABLE_USES record in PCH if there are no entries.Argyrios Kyrtzidis2010-08-032-12/+16
| | | | llvm-svn: 110122
* fix some undefined behavior, PR7779.Chris Lattner2010-08-031-3/+4
| | | | llvm-svn: 110116
* Reshuffle the PCH generator action and consumer, so that we can re-useDouglas Gregor2010-08-033-41/+77
| | | | | | it while generating precompiled preambles. No functionality change. llvm-svn: 110108
* Add -cc1 option '-unoptimized-cfg' to toggle using a CFG (for static ↵Ted Kremenek2010-08-031-0/+1
| | | | | | analysis) that doesn't prune CFG edges. llvm-svn: 110087
* Simplify global method pool implementation in Sema. No functionality change.Sebastian Redl2010-08-021-38/+5
| | | | llvm-svn: 110078
* When using a precompiled preamble, save the diagnostics produced whenDouglas Gregor2010-08-021-15/+41
| | | | | | | | creating the preamble and "replay" them when reusing the preamble. Also, fix a thinko in the copying of the preamble when building the precompiled preamble. llvm-svn: 110061
* Query only the latest version of an identifier in the PCH chain. Make sure ↵Sebastian Redl2010-08-022-22/+7
| | | | | | this version holds the entire declaration chain. This is a much saner solution than trying to merge the info from all elements, and makes redeclarations work properly. Expand the declarations test case to cover more compliated cases. llvm-svn: 110052
* Read/write in PCH Sema's StdNamespace and StdBadAlloc and use a LazyDeclPtr ↵Argyrios Kyrtzidis2010-08-022-0/+27
| | | | | | for them that will deserialize them when needed. llvm-svn: 110031
* Driver/OpenBSD: Update toolchain for compiler changes / C++; patch by JonathanDaniel Dunbar2010-08-011-0/+8
| | | | | | Gray. llvm-svn: 109994
* Implement dependency analysis for the precompiled preamble. If any ofDouglas Gregor2010-07-311-14/+91
| | | | | | | the files in the precompiled preamble have changed since it was build, force the preamble to be rebuilt. llvm-svn: 109937
* Add some timers to ASTUnit that are only enabled when the LIBCLANG_TIMING ↵Douglas Gregor2010-07-301-15/+55
| | | | | | environment variable is set. llvm-svn: 109890
* Safely get a data pointer for vectors that might be empty.Sebastian Redl2010-07-301-6/+15
| | | | llvm-svn: 109867
* Refactor the way PCHReader tracks whether we are in recursive loading.Argyrios Kyrtzidis2010-07-302-22/+16
| | | | | | | | | | -Replace CurrentlyLoadingTypeOrDecl with a counting scheme (NumCurrentElementsDeserializing) -Provide outside access to the mechanism by adding methods StartedDeserializing/FinishedDeserializing to ExternalASTSource. These are preparation for the next commit. llvm-svn: 109856
* Make macro weirdness in chained PCH work. This required changing the way ↵Sebastian Redl2010-07-306-42/+76
| | | | | | PCHReader and PCHWriter are initialized to correctly pick up all initializer. On the upside, this means that there is far less repetition in the dependent PCH now. llvm-svn: 109823
* Change the name to something less terrible; suggestion by Doug. No ↵Argyrios Kyrtzidis2010-07-291-1/+1
| | | | | | functionality change. llvm-svn: 109797
* Implement PCH support for offsetof(base-specifier).Argyrios Kyrtzidis2010-07-292-5/+6
| | | | llvm-svn: 109785
* Merge PCHWriterDecl.cpp's isRequiredDecl and ↵Argyrios Kyrtzidis2010-07-291-52/+1
| | | | | | | | | | | | | | | CodeGenModule::MayDeferGeneration into a new function, DeclIsRequiredFunctionOrFileScopedVar. This is essentially a CodeGen predicate that is also needed by the PCH mechanism to determine whether a decl needs to be deserialized during PCH loading for codegen purposes. Since this logic is shared by CodeGen and the PCH mechanism, move it to the ASTContext, thus CodeGenModule's GetLinkageForFunction/GetLinkageForVariable and the GVALinkage enum is moved out of CodeGen. This fixes current (and avoids future) codegen-from-PCH bugs. llvm-svn: 109784
* Store latest redeclaration for each redeclarable template declarationPeter Collingbourne2010-07-292-0/+7
| | | | | | | This patch adds a Latest field to RedeclarableTemplateDecl's CommonBase class which is used to store the latest redeclaration. llvm-svn: 109755
* Refactor redeclarable template declarationsPeter Collingbourne2010-07-292-37/+39
| | | | | | | | | | | This patch refactors much of the common code in ClassTemplateDecl and FunctionTemplateDecl into a common base class RedeclarableTemplateDecl together with support functions in a template class RedeclarableTemplate. The patch also includes similar refactoring for these classes' PCH reader and writer implementations. llvm-svn: 109754
* Turn off precompiled preamble support for C++Douglas Gregor2010-07-281-1/+2
| | | | llvm-svn: 109680
* Support extended vector types in chained PCH.Sebastian Redl2010-07-281-5/+6
| | | | llvm-svn: 109675
* Record macros in dependent PCHs. Also add various info tables to dependent ↵Sebastian Redl2010-07-272-9/+71
| | | | | | PCHs; tests for this to follow. llvm-svn: 109554
* Revert r109546, it broke linux build.Argyrios Kyrtzidis2010-07-271-2/+52
| | | | llvm-svn: 109550
* Merge PCHWriterDecl.cpp's isRequiredDecl and ↵Argyrios Kyrtzidis2010-07-271-52/+2
| | | | | | | | | | | | CodeGenModule::MayDeferGeneration into a new function, DeclIsRequiredFunctionOrFileScopedVar. This function is part of the public CodeGen interface since it's essentially a CodeGen predicate that is also needed by the PCH mechanism to determine whether a decl needs to be deserialized during PCH loading for codegen purposes. This fixes current (and avoids future) codegen-from-PCH bugs. llvm-svn: 109546
* Update the list of lexical decls in the TU for chained PCHs. This makes ↵Sebastian Redl2010-07-273-5/+27
| | | | | | -ast-print show the decls from the dependent PCH. llvm-svn: 109524
* Fix use-after-free with precompiled preamblesDouglas Gregor2010-07-271-3/+9
| | | | llvm-svn: 109505
* Always deserialize from PCH file scoped variables with non trivial ↵Argyrios Kyrtzidis2010-07-271-0/+8
| | | | | | | | constructor/destructor. Fixes http://llvm.org/PR7692 llvm-svn: 109501
* PTH generation: Don't save the leading '#' token in a null directive. This ↵Ted Kremenek2010-07-271-4/+9
| | | | | | unbreaks using PTH with Boost (<rdar://problem/8227989>). llvm-svn: 109484
* Implement -fno-validate-pch at the -cc1 level, which suppresses mostDouglas Gregor2010-07-275-18/+33
| | | | | | | | | | | | | | | of the usual consistency checks used to determine when a precompiled header is incompatible with the translation unit it's being loaded into. Enable this option when loading a precompiled preamble, because the preamble loader will be performing all of this checking itself. Enable the preamble-based test now that it's working. This option is also useful for debugging Clang's PCH (<rdar://problem/7532213>). llvm-svn: 109475
* - Fix recording of offsets of types in dependent PCHs.Sebastian Redl2010-07-274-43/+68
| | | | | | | - Stop reading in (and thus deserializing) every declaration in the TU when creating a dependent PCH. - Switch the storage of a decl context's lexical declarations to a blob containing the IDs instead of a record. This is the only sane way of supporting update records later on. llvm-svn: 109474
* Introduce basic support for loading a precompiled preamble whileDouglas Gregor2010-07-264-19/+82
| | | | | | | | | | | | | | | | | | | | | | | reparsing an ASTUnit. When saving a preamble, create a buffer larger than the actual file we're working with but fill everything from the end of the preamble to the end of the file with spaces (so the lexer will quickly skip them). When we load the file, create a buffer of the same size, filling it with the file and then spaces. Then, instruct the lexer to start lexing after the preamble, therefore continuing the parse from the spot where the preamble left off. It's now possible to perform a simple preamble build + parse (+ reparse) with ASTUnit. However, one has to disable a bunch of checking in the PCH reader to do so. That part isn't committed; it will likely be handled with some other kind of flag (e.g., -fno-validate-pch). As part of this, fix some issues with null termination of the memory buffers created for the preamble; we were trying to explicitly NULL-terminate them, even though they were also getting implicitly NULL terminated, leading to excess warnings about NULL characters in source files. llvm-svn: 109445
* It's not necessary to call flush() on a raw_ostream immediately priorDan Gohman2010-07-261-1/+0
| | | | | | to deleting it. llvm-svn: 109441
* Add source location information to C++ base specifiers.Nick Lewycky2010-07-264-10/+9
| | | | llvm-svn: 109396
* Eliminate the "minimal" and printing parser actions, which only everDouglas Gregor2010-07-264-881/+0
| | | | | | | worked for C anyway. Also kills the -cc1 options -parse-noop and -parse-print-callbacks. llvm-svn: 109392
* Make ASTContext always use the BumpPtrAllocator.Douglas Gregor2010-07-252-2/+0
| | | | llvm-svn: 109375
* Remove emacs file mode marker on file with .cpp extension.Nick Lewycky2010-07-251-1/+1
| | | | llvm-svn: 109366
* Add header searching for llvm-gcc trunk on Gentoo AMD64. Patch by Mark Wood!Nick Lewycky2010-07-241-1/+6
| | | | llvm-svn: 109357
* Put a newline at the end of the padded buffers used for theDouglas Gregor2010-07-241-4/+6
| | | | | | | precompiled preamble. This will suppress the -pedantic "no newline at end of file" warning. llvm-svn: 109301
* Once we've built (or reused) a precompiled preamble, create theDouglas Gregor2010-07-241-31/+45
| | | | | | | | appropriately-padded main file buffer (that has spaces in the extra "reserved" space) and thread that buffer through to the parsing function. This still does nothing. llvm-svn: 109299
* Once we've built a precompiled preamble, keep track of the details ofDouglas Gregor2010-07-231-42/+164
| | | | | | | | | | | | that preamble (the preamble text, preamble file, reserved main file size). Check these details when we try to rebuild the precompiled preamble, and when nothing has changed, re-use the precompiled preamble. This code is still very much a WIP, and can't even properly be tested because we have no way to use the precompiled preamble yet. "Trust me" llvm-svn: 109294
* Make declarations in the dependent PCH visible, for C at least.Sebastian Redl2010-07-233-11/+36
| | | | llvm-svn: 109292
* PCH read/write for selector reference pool.Fariborz Jahanian2010-07-232-0/+43
| | | | | | Finishes off radar 6507158. llvm-svn: 109256
* Fix build on Ubuntu 10.04.Zhongxing Xu2010-07-231-0/+1
| | | | llvm-svn: 109208
* Basic plumbing for generating a precompiled preamble for anDouglas Gregor2010-07-232-8/+201
| | | | | | | ASTUnit/CXTranslationUnit. We can't actually use this preamble yet, however. llvm-svn: 109202
* Thread bitstream cursors all the way through the AST reading stuff. This ↵Sebastian Redl2010-07-223-79/+105
| | | | | | way, reading a trivial 2-element chained file actually works. llvm-svn: 109191
OpenPOWER on IntegriCloud