diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-12-03 00:30:27 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-12-03 00:30:27 +0000 |
commit | e664977aca2a05a77abab5a06dc0fb69e870cfb9 (patch) | |
tree | 654ca3bf80083d7959029009b263314b6c6dbd29 /lib/AST/Decl.cpp | |
parent | 93ebfa6139bbca4d446c7343e3afc8e5ec777484 (diff) |
Keep track of all of the import declarations that are parsed or
implicitly generated in a translation unit. Modules will need this
information to identify the actual imports that occurred.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145734 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 1ed149b68f..34eefc0dcc 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -2629,7 +2629,8 @@ static unsigned getNumModuleIdentifiers(Module *Mod) { ImportDecl::ImportDecl(DeclContext *DC, SourceLocation ImportLoc, Module *Imported, ArrayRef<SourceLocation> IdentifierLocs) - : Decl(Import, DC, ImportLoc), ImportedAndComplete(Imported, true) + : Decl(Import, DC, ImportLoc), ImportedAndComplete(Imported, true), + NextLocalImport() { assert(getNumModuleIdentifiers(Imported) == IdentifierLocs.size()); SourceLocation *StoredLocs = reinterpret_cast<SourceLocation *>(this + 1); @@ -2639,7 +2640,8 @@ ImportDecl::ImportDecl(DeclContext *DC, SourceLocation ImportLoc, ImportDecl::ImportDecl(DeclContext *DC, SourceLocation ImportLoc, Module *Imported, SourceLocation EndLoc) - : Decl(Import, DC, ImportLoc), ImportedAndComplete(Imported, false) + : Decl(Import, DC, ImportLoc), ImportedAndComplete(Imported, false), + NextLocalImport() { *reinterpret_cast<SourceLocation *>(this + 1) = EndLoc; } |