summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
Commit message (Collapse)AuthorAgeFilesLines
...
* Tweak submodule ID handling in the AST writerDouglas Gregor2011-12-122-6/+9
| | | | llvm-svn: 146445
* Use llvm::sys::fs::equivalent rather than comparing inodes, becauseDouglas Gregor2011-12-091-6/+5
| | | | | | comparing inodes doesn't actually work on Windows. llvm-svn: 146260
* Move ChainedIncludesSource into the Frontend library. This never reallyChandler Carruth2011-12-092-241/+0
| | | | | | | | | | belonged in the Serialization library, it's setting up a compilation, not just deserializing. This should fix PR11512, making Serialization actually be layered below Frontend, a long standing layering violation in Clang. llvm-svn: 146233
* Clean up the comments for this file now that its contents are totallyChandler Carruth2011-12-091-4/+3
| | | | | | | | different from what the comments indicated. Also drop a no longer used include that also violates the layering between Serialization and Frontend. llvm-svn: 146230
* Move a free function from the Frontend library into the Lex library asChandler Carruth2011-12-091-2/+2
| | | | | | | | part of HeaderSearch. This function just normalizes filenames for use inside of a synthetic include directive, but it is used in both the Frontend and Serialization libraries so it needs a common home. llvm-svn: 146227
* Save category name loc in ObjCCategoryImplDecl, patch by Jason Haslam!Argyrios Kyrtzidis2011-12-092-1/+3
| | | | llvm-svn: 146213
* Separate the serialization library's diagnostics from the frontend'sChandler Carruth2011-12-092-2/+2
| | | | | | | diagnostics. Conflating them was highly confusing and makes it harder to establish a firm layering separation between these two libraries. llvm-svn: 146207
* Implement umbrella directories for modules, which are similar toDouglas Gregor2011-12-082-4/+36
| | | | | | | | | | | | | | | umbrella headers in the sense that all of the headers within that directory (and eventually its subdirectories) are considered to be part of the module with that umbrella directory. However, unlike umbrella headers, which are expected to include all of the headers within their subdirectories, Clang will automatically include all of the headers it finds in the named subdirectory. The intent here is to allow a module map to trivially turn a subdirectory into a module, where the module's structure can mimic the directory structure. llvm-svn: 146165
* Within the module representation, generalize the notion of an umbrellaDouglas Gregor2011-12-082-4/+4
| | | | | | | | | | header to also support umbrella directories. The umbrella directory for an umbrella header is the directory in which the umbrella header resides. No functionality change yet, but it's coming. llvm-svn: 146158
* Remove unused-but-set variable.Benjamin Kramer2011-12-071-2/+0
| | | | llvm-svn: 146034
* Implement inferred submodules support, which (when requested)Douglas Gregor2011-12-062-29/+41
| | | | | | | implicitly generates submodules corresponding to the headers that fall within a module. llvm-svn: 145887
* Parse inferred submodules in module maps, track their contents inDouglas Gregor2011-12-052-1/+18
| | | | | | | Module, and (de-)serialize this information. Semantics of inferred submodules to follow. llvm-svn: 145864
* Implement support for wildcard exports in modules, allowing a moduleDouglas Gregor2011-12-052-11/+61
| | | | | | | | to re-export anything that it imports. This opt-in feature makes a module behave more like a header, because it can be used to re-export the transitive closure of a (sub)module's dependencies. llvm-svn: 145811
* Actually add a useful bit to the comment pre-FIXMEDouglas Gregor2011-12-051-1/+1
| | | | llvm-svn: 145809
* When writing a module file, keep track of the set of (sub)modules thatDouglas Gregor2011-12-052-30/+69
| | | | | | | it imports, establishing dependencies at the (sub)module granularity. This is not a user-visible change (yet). llvm-svn: 145808
* [PCH] Make sure that the SourceExpr of a OpaqueValueExpr is always initializedArgyrios Kyrtzidis2011-12-032-27/+4
| | | | | | | | | | when deserialized, fixing random crashes in libclang. Also simplifies how OpaqueValueExprs are [de]serialized. The reader/writer automatically retains pointer equality of sub-statements (when a statement node is referenced in multiple nodes), so no need to manually handle it. llvm-svn: 145752
* Module files representing actual modules don't need to know the set of ↵Douglas Gregor2011-12-031-19/+20
| | | | | | modules they import, since that information isn't actually used. Drop it from the AST file llvm-svn: 145738
* Implement support for precompiled headers, preambles, and serializedDouglas Gregor2011-12-032-0/+42
| | | | | | | | "main" files that import modules. When loading any of these kinds of AST files, we make the modules that were imported visible into the translation unit that loaded the PCH file or preamble. llvm-svn: 145737
* Introduce a module import declaration, so that we properly represent, e.g.,Douglas Gregor2011-12-022-0/+39
| | | | | | | | __import_module__ std.vector; in the AST. llvm-svn: 145725
* Only perform checking of the predefines buffer when loading aDouglas Gregor2011-12-021-2/+2
| | | | | | | | | | | | | precompiled header. Previously, we were trying to gather predefines buffers from all kinds of AST files (which doesn't make sense) and were performing some validation when AST files were loaded as main files. With these tweaks, using PCH files that import modules no longer fails immediately (due to mismatched predefines buffers). However, module visibility is lost, so this feature does not yet work. llvm-svn: 145709
* When making a module visible, also make any of its exported modulesDouglas Gregor2011-12-021-0/+12
| | | | | | | visible, allowing one to create modules that import (and then re-export) other modules. llvm-svn: 145696
* Implement (de-)serialization of the set of exported modules in aDouglas Gregor2011-12-022-1/+51
| | | | | | module map. llvm-svn: 145695
* Notify the AST writer (via ASTDeserializationListener) when aDouglas Gregor2011-12-022-0/+11
| | | | | | | (sub)module is read from an AST file. This makes sure that the AST writer knows how to map all modules to their global IDs. llvm-svn: 145685
* Implement name hiding for macro definitions within modules, such thatDouglas Gregor2011-12-022-11/+40
| | | | | | | | only the macro definitions from visible (sub)modules will actually be visible. This provides the same behavior for macros that r145640 provided for declarations. llvm-svn: 145683
* Implement name hiding for declarations deserialized from a non-visibleDouglas Gregor2011-12-013-5/+51
| | | | | | module. When that module becomes visible, so do those declarations. llvm-svn: 145640
* Introduce the notion of name visibility into modules. For a givenDouglas Gregor2011-12-011-0/+32
| | | | | | | | | | | | | | (sub)module, all of the names may be hidden, just the macro names may be exposed (for example, after the preprocessor has seen the import of the module but the parser has not), or all of the names may be exposed. Importing a module makes its names, and the names in any of its non-explicit submodules, visible to name lookup (transitively). This commit only introduces the notion of name visible and marks modules and submodules as visible when they are imported. The actual name-hiding logic in the AST reader will follow (along with test cases). llvm-svn: 145586
* Infer the submodule ID for a given declaration based on the locationDouglas Gregor2011-12-013-4/+52
| | | | | | | of that declaration, and encode the submodule ID in each declaration stored in an AST file. llvm-svn: 145555
* Switch the ID numbers used for submodule IDs in the AST reader over toDouglas Gregor2011-12-013-16/+120
| | | | | | | | a standard global/local scheme, so that submodule definitions will eventually be able to refer to submodules in other top-level modules. We'll need this functionality soonish. llvm-svn: 145549
* Promote ModuleMap::Module to a namespace-scope class in the BasicDouglas Gregor2011-11-308-143/+143
| | | | | | | | | library, since modules cut across all of the libraries. Rename serialization::Module to serialization::ModuleFile to side-step the annoying naming conflict. Prune a bunch of ModuleMap.h includes that are no longer needed (most files only needed the Module type). llvm-svn: 145538
* [PCH] In ASTReader::FinishedDeserializing, after we do ↵Argyrios Kyrtzidis2011-11-301-29/+43
| | | | | | | | | | | | | PassInterestingDeclsToConsumer we may end up having added more pending stuff to do, so go in a loop until everything is cleared out. This fixes the error in rdar://10278815 which has a certain David Lynch-esque quality.. error: unknown type name 'BOOL'; did you mean 'BOOL'? llvm-svn: 145536
* Implement (de-)serialization of the description of a module and itsDouglas Gregor2011-11-302-1/+208
| | | | | | | | | submodules. This information will eventually be used for name hiding when dealing with submodules. For now, we only use it to ensure that the module "key" returned when loading a module will always be a module (rather than occasionally being a FileEntry). llvm-svn: 145497
* When writing a module file, pass the module through to the ASTDouglas Gregor2011-11-303-10/+11
| | | | | | writer. No functionality change. llvm-svn: 145479
* [PCH] Check for isTopLevelDeclInObjCContainer when picking abbreviations.Argyrios Kyrtzidis2011-11-231-0/+5
| | | | llvm-svn: 145110
* [libclang] Fix operations (token annotation, getting cursor, etc.) with a ↵Argyrios Kyrtzidis2011-11-233-0/+17
| | | | | | | | | | | | | | | file region inside an objc container that "contains" other file-level declarations. When getting the array of file-level declarations that overlap with a file region, we failed to report that the region overlaps with an objc container, if the container had other file-level declarations declared lexically inside it. Fix this by marking such declarations as "isTopLevelDeclInObjCContainer" in the AST and handling them appropriately. llvm-svn: 145109
* If we're dealing with an overridden buffer in the AST reader, load theDouglas Gregor2011-11-171-2/+4
| | | | | | file as a virtual file with the stored modification time and size. llvm-svn: 144916
* Try to appease the failing buildbot where I can't reproduce the problemDouglas Gregor2011-11-171-2/+4
| | | | llvm-svn: 144879
* Implement (de-)serialization of the buffer contents for an overriddenDouglas Gregor2011-11-162-17/+54
| | | | | | | | | | file in the source manager. This allows us to properly create and use modules described by module map files without umbrella headers (or with incompletely umbrella headers). More generally, we can actually build a PCH file that makes use of file -> buffer remappings, which could be useful in libclang in the future. llvm-svn: 144830
* Add a -cc1-level option -fmodule-name=<name>, which will be used whenDouglas Gregor2011-11-152-0/+7
| | | | | | building modules. llvm-svn: 144680
* [PCH] When serializing an PseudoObjectExpr or AtomicExpr, the serialization ↵Argyrios Kyrtzidis2011-11-151-0/+4
| | | | | | | | code must be set otherwise it will crash with asserts on or it will be written as null pointer. llvm-svn: 144626
* Use Decl's isImplicit field to indicate whether an ObjCInterfaceDecl is ↵Argyrios Kyrtzidis2011-11-152-2/+0
| | | | | | | | 'ImplicitInterfaceDecl', no need to store it in another field. llvm-svn: 144624
* [PCH] Load the chained objc categories only after recursive loading is finishedArgyrios Kyrtzidis2011-11-142-2/+12
| | | | | | otherwise we may crash. llvm-svn: 144524
* [PCH] Do not crash if a class extension in a chained PCH ↵Argyrios Kyrtzidis2011-11-141-0/+14
| | | | | | introduces/redeclares a property. llvm-svn: 144520
* [PCH] In ASTWriter::WriteChainedObjCCategories use getDeclID since the declsArgyrios Kyrtzidis2011-11-141-6/+5
| | | | | | should have been already emitted. llvm-svn: 144519
* [PCH] When chaining a PCH and serializing HeaderSearch, make sure the ↵Argyrios Kyrtzidis2011-11-131-4/+6
| | | | | | | | | HeaderFileInfos from the primary PCH is deserialized, otherwise we lose info that headers were already #imported/#included. llvm-svn: 144510
* Fix the signature of the getcontext builtin. Patch by Dimitry Andric.Rafael Espindola2011-11-132-0/+19
| | | | llvm-svn: 144505
* Add a method in ASTMutationListener for the last use of Decl's ↵Argyrios Kyrtzidis2011-11-121-8/+8
| | | | | | | | [is/set]ChangedSinceDeserialization and remove them. llvm-svn: 144466
* [PCH] When completing an objc forward reference, do not serialize the chain ↵Argyrios Kyrtzidis2011-11-122-18/+17
| | | | | | | | | | | | | | | of its categories because it is going to be rewritten (and the chain will be serialized again), otherwise we may form a cycle in its categories list when deserializing. Also introduce ASTMutationListener::CompletedObjCForwardRef to notify that a forward reference was completed; using Decl's isChangedSinceDeserialization/setChangedSinceDeserialization is bug inducing and kinda gross, we should phase it out. Fixes infinite loop in rdar://10418538. llvm-svn: 144465
* Rename SPECIAL_TYPE_jmp_buf and SPECIAL_TYPE_sigjmp_buf to follow theDouglas Gregor2011-11-111-2/+2
| | | | | | convention of SPECIAL_TYPE*. llvm-svn: 144403
* There's no good reason to track temporaries in ExprWithCleanups,John McCall2011-11-102-11/+12
| | | | | | | but it is sometimes useful to track blocks. Do so. Also optimize the storage of these expressions. llvm-svn: 144263
* [PCH] Fix reading from PCH of diagnostic pragmas.Argyrios Kyrtzidis2011-11-091-2/+6
| | | | | | | | | | | In certain cases ASTReader would call the normal DiagnosticsEngine API to initialize the state of diagnostic pragmas but DiagnosticsEngine would try to compare source locations leading to crash because the main FileID was not yet initialized. Yet another case of the ASTReader trying to use the normal APIs and inadvertently breaking invariants. Fix this by having the ASTReader set up the internal state directly. llvm-svn: 144153
OpenPOWER on IntegriCloud