summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Add a FileCharacteristic parameter to SourceManager::createFileIDForMemBufferArgyrios Kyrtzidis2012-11-091-2/+4
| | | | | | | for completeness and use it in CompilerInstance::InitializeSourceManager if the input is a memory buffer. llvm-svn: 167628
* When loading a module fails because it is out of date, rebuild thatDouglas Gregor2012-11-071-9/+14
| | | | | | module in place. <rdar://problem/10138913> llvm-svn: 167539
* Tease out the routine that reads the control block of an AST file fromDouglas Gregor2012-11-061-26/+34
| | | | | | the validation of an AST file against a specific set of options. llvm-svn: 167504
* [PCH] Take into account the 'include' source location of a SM_SLOC_BUFFER_ENTRY.Argyrios Kyrtzidis2012-11-061-1/+3
| | | | llvm-svn: 167426
* [libclang] Correct how the index inside the local preprocessed entities arrayArgyrios Kyrtzidis2012-11-021-5/+3
| | | | | | is getting converted to a global PreprocessedEntityID. llvm-svn: 167280
* [PCH] Remove the stat cache from the PCH file.Argyrios Kyrtzidis2012-10-311-115/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The stat cache became essentially useless ever since we started validating all file entries in the PCH. But the motivating reason for removing it now is that it also affected correctness in this situation: -You have a header without include guards (using "#pragma once" or #import) -When creating the PCH: -The same header is referenced in an #include with different filename cases. -In the PCH, of course, we record only one file entry for the header file -But we cache in the PCH file the stat info for both filename cases -Then the source files are updated and the header file is updated in a way that its size and modification time are the same but its inode changes -When using the PCH: -We validate the headers, we check that header file and we create a file entry with its current inode -There's another #include with a filename with different case than the previously created file entry -In order to get its stat info we go through the cached stat info of the PCH and we receive the old inode -because of the different inodes, we think they are different files so we go ahead and include its contents. Removing the stat cache will potentially break clients that are attempting to use the stat cache as a way of avoiding having the actual input files available. If that use case is important, patches are welcome to bring it back in a way that will actually work correctly (i.e., emit a PCH that is self-contained, coping with literal strings, line/column computations, etc.). This fixes rdar://5502805 llvm-svn: 167172
* getOriginalSourceFileName and getOriginalSourceFile can return a StringRef.Rafael Espindola2012-10-301-6/+5
| | | | | | | MaybeAddSystemRootToFilename doesn't need to return anything, it modifies its argument. llvm-svn: 166988
* [PCH] The diagnostic state points can refer to previously createdArgyrios Kyrtzidis2012-10-301-6/+18
| | | | | | | | | diagnostic states; make sure the ASTReader sets the diagnostic state properly instead of always recreating it. Fixes rdar://12581618 & http://llvm.org/PR14181 llvm-svn: 166987
* Remove the old predefines-buffer diffing code completely. It's beenDouglas Gregor2012-10-251-332/+1
| | | | | | | replaced by the more efficient, cleaner preprocessor-option version that occurs earlier in PCH validation. llvm-svn: 166654
* Fix computation of predefines buffer from the preprocessor-optionDouglas Gregor2012-10-251-10/+1
| | | | | | checking, and disable the old predefines-buffer-diff'ing code path. llvm-svn: 166653
* The the preprocessor option validator to compute suggestedDouglas Gregor2012-10-251-14/+72
| | | | | | | predefines. We're not quite ready to cut over to these suggested predefines yet, however. llvm-svn: 166648
* Teach the PCH validator to check the preprocessor options, especiallyDouglas Gregor2012-10-241-6/+128
| | | | | | | | | | | | | | | the macros that are #define'd or #undef'd on the command line. This checking happens much earlier than the current macro-definition checking and is far cleaner, because it does a direct comparison rather than a diff of the predefines buffers. Moreover, it allows us to use the result of this check to skip over PCH files within a directory that have non-matching -D's or -U's on the command line. Finally, it improves the diagnostics a bit for mismatches, fixing <rdar://problem/8612222>. The old predefines-buffer diff'ing will go away in a subsequent commit. llvm-svn: 166641
* (De-)serialize the preprocessor options, including macros defined,Douglas Gregor2012-10-241-0/+45
| | | | | | -include'd files, etc. llvm-svn: 166614
OpenPOWER on IntegriCloud