summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Frontend] Remove HeaderSearchOptions::Entry::IsInternal, which is unused.Daniel Dunbar2013-01-301-3/+1
| | | | llvm-svn: 173866
* [Frontend] Add an ExternCSystem include entry group.Daniel Dunbar2013-01-301-2/+1
| | | | | | | | - The only group where it makes sense for the "ExternC" bit is System, so this simplifies having to have the extra isCXXAware (or ImplicitExternC, depending on what code you talk to) bit caried around. llvm-svn: 173859
* Add some more ASTReader statistics for global method pool lookups.Douglas Gregor2013-01-281-7/+23
| | | | llvm-svn: 173702
* Preserve Sema::UndefinedInternals across PCH boundaries. FixesNick Lewycky2013-01-261-1/+29
| | | | | | -Wundefined-internal warnings with PCH. llvm-svn: 173538
* Improve coordination between the module manager and the global moduleDouglas Gregor2013-01-251-19/+15
| | | | | | | | | index, optimizing the operation that skips lookup in modules where we know the identifier will not be found. This makes the global module index optimization actually useful, providing an 8.5% speedup over modules without the global module index for -fsyntax-only. llvm-svn: 173529
* [Frontend] Remove another IsUserSpecified member variable that is now unused.Daniel Dunbar2013-01-251-3/+2
| | | | llvm-svn: 173412
* Implement the reader of the global module index and wire it into theDouglas Gregor2013-01-251-8/+69
| | | | | | | | | | | | | | | | | | | | | | | AST reader. The global module index tracks all of the identifiers known to a set of module files. Lookup of those identifiers looks first in the global module index, which returns the set of module files in which that identifier can be found. The AST reader only needs to look into those module files and any module files not known to the global index (e.g., because they were (re)built after the global index), reducing the number of on-disk hash tables to visit. For an example source I'm looking at, we go from 237844 total identifier lookups into on-disk hash tables down to 126817. Unfortunately, this does not translate into a performance advantage. At best, it's a wash once the global module index has been built, but that's ignore the cost of building the global module index (which is itself fairly large). Profiles show that the global module index code is far less efficient than it should be; optimizing it might give enough of an advantage to justify its continued inclusion. llvm-svn: 173405
* Rename the -cc1 option "-generate-module-index" toDouglas Gregor2013-01-251-1/+2
| | | | | | | "-fmodules-global-index" and expand its behavior to include both the use and generation of the global module index. llvm-svn: 173404
* Track the number of lookups and hits into the on-disk hash tables forDouglas Gregor2013-01-251-9/+32
| | | | | | identifiers within the AST file reader. llvm-svn: 173403
* Implement the writer side of the global module index. Douglas Gregor2013-01-231-2/+3
| | | | | | | | | | | | | | | | | | | | The global module index is a "global" index for all of the module files within a particular subdirectory in the module cache, which keeps track of all of the "interesting" identifiers and selectors known in each of the module files. One can perform a fast lookup in the index to determine which module files will have more information about entities with a particular name/selector. This information can help eliminate redundant lookups into module files (a serious performance problem) and help with creating auto-import/auto-include Fix-Its. The global module index is created or updated at the end of a translation unit that has triggered a (re)build of a module by scraping all of the .pcm files out of the module cache subdirectory, so it catches everything. As with module rebuilds, we use the file system's atomicity to synchronize. llvm-svn: 173301
* Factor the trait for lookup into the on-based hash table ofDouglas Gregor2013-01-231-13/+11
| | | | | | | | | identifiers into two parts: the part that involves dealing with the key (which can be re-used) and the ASTReader-specific part that creates the IdentifierInfos. While I'm at it, StringRef'ify this code, which was using pair<const char*, unsigned>. No functionality change. llvm-svn: 173283
* Make getDefinitiveDeclContext() actually return a DeclContext, as oneDouglas Gregor2013-01-221-2/+2
| | | | | | | would expect, and clean up the return/break inconsistencies. Thanks, Sebastian! llvm-svn: 173171
* Switch to APFloat constructor taking fltSemantics.Tim Northover2013-01-221-2/+4
| | | | | | | | This change also makes the serialisation store the required semantics, fixing an issue where PPC128 was always assumed when re-reading a 128-bit value. llvm-svn: 173139
* ReadSourceManagerBlock is skipping over records that can contain Blobs. Not ↵Chris Lattner2013-01-211-1/+2
| | | | | | | | | passing in a StringRef to bind to them forces them to be unpacked into the Record as individual bytes. This is wasteful, but not likely to be measurable in this instance. llvm-svn: 173066
* Revert r173056; it breaks one of the CodeGen-with-PCH tests.Douglas Gregor2013-01-211-18/+8
| | | | llvm-svn: 173058
* When loading an identifier from an AST file solely for the purpose ofDouglas Gregor2013-01-211-8/+18
| | | | | | | | | | forming the identifier, e.g., as part of a selector or a declaration name, don't actually deserialize any information about the identifier. Instead, simply mark it "out-of-date" and we'll load the the information on demand. 2% speedup on the modules testcase I'm looking at; should also help PCH. llvm-svn: 173056
* Introduce a fast path for the ASTReader's name lookup within aDouglas Gregor2013-01-211-2/+32
| | | | | | | | | DeclContext. When the DeclContext is of a kind that can only be defined once and never updated, we limit the search to the module file that conatins the lookup table. Provides a 15% speedup in one modules-heavy source file. llvm-svn: 173050
* Implement OpenCL event_t as Clang builtin type, including event_t related ↵Guy Benyei2013-01-201-0/+1
| | | | | | OpenCL restrictions (OpenCL 1.2 spec 6.9) llvm-svn: 172973
* update to use the new BitcodeCursor readRecord that takes a StringRef blob ↵Chris Lattner2013-01-201-110/+78
| | | | | | | | parameter, and adopt "advance" in more places. llvm-svn: 172951
* add back a #include needed on some builders.Chris Lattner2013-01-201-0/+1
| | | | llvm-svn: 172938
* finish converting the normal cases in ASTReader to use the new ↵Chris Lattner2013-01-201-202/+147
| | | | | | BitstreamCursor APIs. llvm-svn: 172937
* convert some more stuff over to use new cursor APIs.Chris Lattner2013-01-201-37/+34
| | | | llvm-svn: 172932
* switch a bunch of ASTReader to use the new BitstreamCursor::advance* methods,Chris Lattner2013-01-191-162/+145
| | | | | | | which hide a bunch of private details of the cursor from clients and simplify their code. More to come. llvm-svn: 172922
* [PCH/Modules] Revert r172843, it caused a module to fail building.Argyrios Kyrtzidis2013-01-191-29/+26
| | | | llvm-svn: 172884
* Remove unused variableMatt Beaumont-Gay2013-01-181-1/+0
| | | | llvm-svn: 172862
* [PCH/Modules] Re-apply r172620 and r172629, now with 100% less infinite loops!Argyrios Kyrtzidis2013-01-181-26/+30
| | | | | | | | | Makes sure that a deserialized macro is only added to the preprocessor macro definitions only once. Unfortunately I couldn't get a reduced test case. rdar://13016031 llvm-svn: 172843
* [ubsan] Add support for -fsanitize-blacklistWill Dietz2013-01-181-0/+2
| | | | llvm-svn: 172808
* Revert Clang r172620 and r172629, which caused a hang when buildingDouglas Gregor2013-01-181-21/+40
| | | | | | | complicated modules (<rdar://problem/13038265>). Unfortunately, this un-fixes <rdar://problem/13016031>. llvm-svn: 172783
* [PCH/Modules] The iterator may become invalidated because a new macro can be ↵Argyrios Kyrtzidis2013-01-161-2/+4
| | | | | | | | | | added while deserializing a macro, make sure to copy/move what we need from it. Fixes clang-x86_64-debian-fast bot. llvm-svn: 172629
* [PCH/Modules] Change how macro [re]definitions are de/serialized.Argyrios Kyrtzidis2013-01-161-40/+19
| | | | | | | | | | | | | | | | | | Previously we would serialize the macro redefinitions as a list, part of the identifier, and try to chain them together across modules individually without having the info that they were already chained at definition time. Change this by serializing the macro redefinition chain and then try to synthesize the chain parts across modules. This allows us to correctly pinpoint when 2 different definitions are ambiguous because they came from unrelated modules. Fixes bogus "ambiguous expansion of macro" warning when a macro in a PCH is redefined without undef'ing it first. rdar://13016031 llvm-svn: 172620
* Implement parsing, AST, (de-)serialization, and placeholder globalDouglas Gregor2013-01-141-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | metadata for linking against the libraries/frameworks for imported modules. The module map language is extended with a new "link" directive that specifies what library or framework to link against when a module is imported, e.g., link "clangAST" or link framework "MyFramework" Importing the corresponding module (or any of its submodules) will eventually link against the named library/framework. For now, I've added some placeholder global metadata that encodes the imported libraries/frameworks, so that we can test that this information gets through to the IR. The format of the data is still under discussion. llvm-svn: 172437
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-16/+16
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Provide Decl::getOwningModule(), which determines the (sub)module inDouglas Gregor2013-01-121-1/+5
| | | | | | | | | | | | | which a particular declaration resides. Use this information to customize the "definition of 'blah' must be imported from another module" diagnostic with the module the user actually has to import. Additionally, recover by importing that module, so we don't complain about other names in that module. Still TODO: coming up with decent Fix-Its for these cases, and expand this recovery approach for other name lookup failures. llvm-svn: 172290
* [PCH] Make the const_cast explicit to silence a compiler warning.Argyrios Kyrtzidis2013-01-111-1/+2
| | | | | | Patch by David Greene. llvm-svn: 172262
* Truth in advertising: LocallyScopedExternalDecls actually only containsRichard Smith2013-01-101-7/+7
| | | | | | external declarations with C language linkage. llvm-svn: 172150
* [PCH] (De)serialize the end location of MacroInfo.Argyrios Kyrtzidis2013-01-071-0/+1
| | | | llvm-svn: 171772
* [PCH/Modules] In ASTReader::completeVisibleDeclsMap, make sure to visit allArgyrios Kyrtzidis2012-12-191-4/+7
| | | | | | | | | | modules when getting the decls for a namespace or translation unit. Otherwise the code-completion results will not be complete. rdar://12889089 llvm-svn: 170596
* Re-commit r170428 changes with Linux style file endings.Guy Benyei2012-12-181-0/+6
| | | | | | Add OpenCL images as clang builtin types. llvm-svn: 170432
* Revert changes from r170428, as I accidentally changed the line endings of ↵Guy Benyei2012-12-181-6998/+6992
| | | | | | these files to Windows style. llvm-svn: 170431
* Add OpenCL images as clang builtin types.Guy Benyei2012-12-181-6992/+6998
| | | | llvm-svn: 170428
* [PCH] Make the new PCH format (control block) backwards compatible andArgyrios Kyrtzidis2012-12-131-0/+10
| | | | | | | | | | | | don't crash when loading a PCH with the older format. The introduction of the control block broke compatibility with PCHs from older versions. This patch allows loading (and rejecting) PCHs from an older version and allows newer PCHs to be rejected from older clang versions as well. rdar://12821386 llvm-svn: 170150
* [PCH] Remove redundant stat call when validating the input files.Argyrios Kyrtzidis2012-12-111-11/+2
| | | | | | This became redundant after we removed the stat cache. llvm-svn: 169830
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-15/+15
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Refactor recording the preprocessor conditional directive regions out ofArgyrios Kyrtzidis2012-12-041-2/+2
| | | | | | | | | PreprocessingRecord and into its own class, PPConditionalDirectiveRecord. Decoupling allows a client to use the functionality of PPConditionalDirectiveRecord without needing a PreprocessingRecord. llvm-svn: 169229
* When we're emitting a diagnostic with a source location in an importedDouglas Gregor2012-11-301-0/+19
| | | | | | | | | | | | | | module, provide a module import stack similar to what we would get for an include stack, e.g., In module 'DependsOnModule' imported from build-fail-notes.m:4: In module 'Module' imported from DependsOnModule.framework/Headers/DependsOnModule.h:1: Inputs/Module.framework/Headers/Module.h:15:12: note: previous definition is here @interface Module <rdar://problem/12696425> llvm-svn: 169042
* Actually keep track of the source locations at which particular moduleDouglas Gregor2012-11-301-2/+3
| | | | | | files are loaded. llvm-svn: 169027
* Introduce ASTUnresolvedSet, an UnresolvedSet-like class, whose contents areArgyrios Kyrtzidis2012-11-281-2/+3
| | | | | | | | | | | allocated using the allocator associated with an ASTContext. Use this inside CXXRecordDecl::DefinitionData instead of an UnresolvedSet to avoid a potential memory leak. rdar://12761275 llvm-svn: 168771
* [modules] Use a memory buffer directly as input for the module includes,Argyrios Kyrtzidis2012-11-151-0/+4
| | | | | | instead of messing with virtual files. llvm-svn: 168062
* [modules] Setup the import location of a module file and use itArgyrios Kyrtzidis2012-11-151-8/+30
| | | | | | as the include location of the main file of an imported module. llvm-svn: 168061
* Suppress elided variadic macro argument extension diagnostic for macros usingEli Friedman2012-11-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | the related comma pasting extension. In certain cases, we used to get two diagnostics for what is essentially one extension. This change suppresses the first diagnostic in certain cases where we know we're going to print the second diagnostic. The diagnostic is redundant, and it can't be suppressed in the definition of the macro because it points at the use of the macro, so we want to avoid printing it if possible. The implementation works by detecting constructs which look like comma pasting at the time of the definition of the macro; this information is then used when the macro is used. (We can't actually detect whether we're using the comma pasting extension until the macro is actually used, but we can detecting constructs which will be comma pasting if the varargs argument is elided.) <rdar://problem/12292192> llvm-svn: 167907
OpenPOWER on IntegriCloud