diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-02-01 16:36:14 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-02-01 16:36:14 +0000 |
| commit | 71c1af8760c2a2f42dfffd9797bf7c5528ef2eb7 (patch) | |
| tree | b460d4b328ead957c228812ed93becf8dea3081c /clang | |
| parent | 125df0589b95ad297242dbdc7239f4421ea19b9b (diff) | |
| download | bcm5719-llvm-71c1af8760c2a2f42dfffd9797bf7c5528ef2eb7.tar.gz bcm5719-llvm-71c1af8760c2a2f42dfffd9797bf7c5528ef2eb7.zip | |
[modules] Introduce ModuleFile::DirectImportLoc which is the source location
where the module was explicitly or implicitly imported in the local translation unit.
llvm-svn: 174192
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/Serialization/Module.h | 8 | ||||
| -rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/clang/include/clang/Serialization/Module.h b/clang/include/clang/Serialization/Module.h index 547bf4c9212..5b019bd0545 100644 --- a/clang/include/clang/Serialization/Module.h +++ b/clang/include/clang/Serialization/Module.h @@ -124,6 +124,14 @@ public: /// \brief The main bitstream cursor for the main block. llvm::BitstreamCursor Stream; + /// \brief The source location where the module was explicitly or implicitly + /// imported in the local translation unit. + /// + /// If module A depends on and imports module B, both modules will have the + /// same DirectImportLoc, but different ImportLoc (B's ImportLoc will be a + /// source location inside module A). + SourceLocation DirectImportLoc; + /// \brief The source location where this module was first imported. SourceLocation ImportLoc; diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 37db83e594a..604b23143e9 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -2779,6 +2779,7 @@ ASTReader::ASTReadResult ASTReader::ReadAST(const std::string &FileName, MEnd = Loaded.end(); M != MEnd; ++M) { ModuleFile &F = *M->Mod; + F.DirectImportLoc = ImportLoc; if (!M->ImportedBy) F.ImportLoc = M->ImportLoc; else |

