summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
* Add OpenCL samplers as Clang builtin types and check sampler related ↵Guy Benyei2013-02-072-0/+2
| | | | | | restrictions. llvm-svn: 174601
* Fix handling of module imports adding names to a DeclContext after qualifiedRichard Smith2013-02-071-4/+11
| | | | | | | | | | | | | | | | name lookup has been performed in that context (this probably only happens in C++). 1) Whenever we add names to a context, set a flag on it, and if we perform lookup and discover that the context has had a lookup table built but has the flag set, update all entries in the lookup table with additional names from the external source. 2) When marking a DeclContext as having external visible decls, mark the context in which lookup is performed, not the one we are adding. These won't be the same if we're adding another copy of a pre-existing namespace. llvm-svn: 174577
* Simplify FindExternalVisibleDeclsByName by making it return a bool indicatingRichard Smith2013-02-071-4/+3
| | | | | | | | | | | | if it found any decls, rather than returning a list of found decls. This removes a returning-ArrayRef-to-deleted-storage bug from MultiplexExternalSemaSource (in code not exercised by any of the clang binaries), reduces the work required in the found-no-decls case with PCH, and importantly removes the need for DeclContext::lookup to be reentrant. No functionality change intended! llvm-svn: 174576
* Detect when we end up trying to load conflicting module files.Douglas Gregor2013-02-061-1/+12
| | | | | | | | | | | | This can happen when one abuses precompiled headers by passing more -D options when using a precompiled hedaer than when it was built. This is intentionally permitted by precompiled headers (and is exploited by some build environments), but causes problems for modules. First part of <rdar://problem/13165109>, detecting when something when horribly wrong. llvm-svn: 174554
* Eliminate a race condition with the global module index.Douglas Gregor2013-02-061-1/+2
| | | | | | | | Essentially, a module file on disk could change size between the time we stat() it and the time we open it, and we need to be robust against such a problem. llvm-svn: 174529
* Remove dead code related to the now defunct PCH stat cache.Ted Kremenek2013-02-053-64/+1
| | | | llvm-svn: 174342
* Merge "special" types from different modules in the AST reader.Douglas Gregor2013-02-011-2/+18
| | | | | | | | | Different modules may have different views of the various "special" types in the AST, such as the redefinition type for "id". Merge those types rather than only considering the redefinition types for the first AST file loaded. llvm-svn: 174234
* [modules] Introduce ModuleFile::DirectImportLoc which is the source locationArgyrios Kyrtzidis2013-02-011-0/+1
| | | | | | where the module was explicitly or implicitly imported in the local translation unit. llvm-svn: 174192
* For ModuleLoader::makeModuleVisible() also pass the source location where theArgyrios Kyrtzidis2013-02-011-2/+4
| | | | | | module import occurred. llvm-svn: 174191
* Add a new -Wundefined-inline warning for inline functions which are used but notNick Lewycky2013-02-012-20/+19
| | | | | | defined. Fixes PR14993! llvm-svn: 174158
* Added outer template parameter lists to friend type AST nodes.Enea Zaffanella2013-01-312-8/+17
| | | | llvm-svn: 174050
* Remove elements from Sema.UndefinedInternals as functions are defined. AlsoNick Lewycky2013-01-312-6/+7
| | | | | | | filter the elements before emitting them into a PCH. No user-visible functionality change, except that PCH files may be smaller? llvm-svn: 174034
* [Frontend] Remove HeaderSearchOptions::Entry::IsInternal, which is unused.Daniel Dunbar2013-01-302-4/+1
| | | | llvm-svn: 173866
* [Frontend] Add an ExternCSystem include entry group.Daniel Dunbar2013-01-302-3/+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
* ASTReader and profiling statistics indicate that implementing a methodDouglas Gregor2013-01-281-4/+0
| | | | | | | pool in the global module index is not worthwhile. Update comments to limit the scope of the global module index to identifiers. llvm-svn: 173705
* Add some more ASTReader statistics for global method pool lookups.Douglas Gregor2013-01-281-7/+23
| | | | llvm-svn: 173702
* Eliminate memory allocation from most invocations ofDouglas Gregor2013-01-281-13/+38
| | | | | | | | | | ModuleManager::visit() by keeping a free list of the two data structures used to store state (a preallocated stack and a visitation number vector). Improves -fsyntax-only performance for my modules test case by 2.8%. Modules has pulled ahead by almost 10% with the global module index. llvm-svn: 173692
* Preserve Sema::UndefinedInternals across PCH boundaries. FixesNick Lewycky2013-01-262-2/+45
| | | | | | -Wundefined-internal warnings with PCH. llvm-svn: 173538
* patch for PR9027 and // rdar://11861085Fariborz Jahanian2013-01-252-0/+3
| | | | | | | | | | | Title: [PR9027] volatile struct bug: member is not loaded at -O; This is caused by last flag passed to @llvm.memcpy being false, not honoring that aggregate has at least one 'volatile' data member (even though aggregate itself has not been qualified as 'volatile'. As a result, optimization optimizes away the memcpy altogether. Patch review by John MaCall (I still need to fix up a test though). llvm-svn: 173535
* Improve coordination between the module manager and the global moduleDouglas Gregor2013-01-253-50/+71
| | | | | | | | | 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
* The standard ARM C++ ABI dictates that inline functions areJohn McCall2013-01-251-3/+3
| | | | | | | | never key functions. We did not implement that rule for the iOS ABI, which was driven by what was implemented in gcc-4.2. However, implement it now for other ARM-based platforms. llvm-svn: 173515
* Optimize ModuleManager::visit() by precomputing the visitation orderDouglas Gregor2013-01-251-65/+82
| | | | | | | | | | and limiting ourselves to two memory allocations. 10% speedup in -fsyntax-only time for modules. With this change, we can actually see some performance different from the global module index, but it's still about 1%. llvm-svn: 173512
* [Frontend] Remove another IsUserSpecified member variable that is now unused.Daniel Dunbar2013-01-252-4/+2
| | | | llvm-svn: 173412
* Serialization/GlobalModuleIndex.cpp: Fixup r173405, <cstdio>NAKAMURA Takumi2013-01-251-0/+1
| | | | llvm-svn: 173408
* Implement the reader of the global module index and wire it into theDouglas Gregor2013-01-253-27/+459
| | | | | | | | | | | | | | | | | | | | | | | 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
* clang/GlobalModuleIndex: Don't open the same file twice. Use ↵NAKAMURA Takumi2013-01-241-3/+1
| | | | | | | raw_fd_ostream(fd, ...) instead. FIXME: PathV2::unique_file() is assumed to open the file with binary mode on win32. llvm-svn: 173330
* Fix for case-sensitive file systems. UghDouglas Gregor2013-01-231-1/+1
| | | | llvm-svn: 173303
* Implement the writer side of the global module index. Douglas Gregor2013-01-233-2/+539
| | | | | | | | | | | | | | | | | | | | 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-232-46/+52
| | | | | | | | | 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-223-9/+10
| | | | | | | would expect, and clean up the return/break inconsistencies. Thanks, Sebastian! llvm-svn: 173171
* Switch to APFloat constructor taking fltSemantics.Tim Northover2013-01-223-4/+9
| | | | | | | | 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
* Give ModuleFiles an index, so that we can use indexed vectors ratherDouglas Gregor2013-01-211-20/+30
| | | | | | | than DenseMaps and SmallPtrSets for module-visitation data. ~2.6% speedup for modules. llvm-svn: 173081
* 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
* When deserializing a declaration, don't look for redeclarations if itsDouglas Gregor2013-01-214-15/+81
| | | | | | | kind indicates that it can never be redeclared. Good for a 1% speedup, and redeclaration searching drops off the profile. llvm-svn: 173054
* Introduce a fast path for the ASTReader's name lookup within aDouglas Gregor2013-01-214-2/+103
| | | | | | | | | 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-202-0/+2
| | | | | | 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-203-137/+93
| | | | | | | | 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
* libclangSerialization also depends on the bitreader.Benjamin Kramer2013-01-191-0/+2
| | | | llvm-svn: 172910
* [PCH/Modules] Revert r172843, it caused a module to fail building.Argyrios Kyrtzidis2013-01-192-41/+44
| | | | 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-182-44/+42
| | | | | | | | | 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-182-0/+4
| | | | llvm-svn: 172808
OpenPOWER on IntegriCloud