summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriterDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-05-18 02:29:20 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-05-18 02:29:20 +0000
commit54f0440c1fe82e9649168628eee5f28c375ff6f3 (patch)
treee88fadd5e07a1553e7923a2d44bcc9a3426c15b0 /clang/lib/Serialization/ASTWriterDecl.cpp
parent6180337fe12acb30fe877533ce37aaaa848982d1 (diff)
downloadbcm5719-llvm-54f0440c1fe82e9649168628eee5f28c375ff6f3.tar.gz
bcm5719-llvm-54f0440c1fe82e9649168628eee5f28c375ff6f3.zip
[modules] Switch from inferring owning modules based on source location to
inferring based on the current module at the point of creation. This should result in no functional change except when building a preprocessed module (or more generally when using #pragma clang module begin/end to switch module in the middle of a file), in which case it allows us to correctly track the owning module for declarations. We can't map from FileID to module in the preprocessed module case, since all modules would have the same FileID. There are still a couple of remaining places that try to infer a module from a source location; I'll clean those up in follow-up changes. llvm-svn: 303322
Diffstat (limited to 'clang/lib/Serialization/ASTWriterDecl.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriterDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp
index 812cd9e916d..8fa64aa1b9d 100644
--- a/clang/lib/Serialization/ASTWriterDecl.cpp
+++ b/clang/lib/Serialization/ASTWriterDecl.cpp
@@ -299,7 +299,7 @@ void ASTDeclWriter::VisitDecl(Decl *D) {
Record.push_back(D->isTopLevelDeclInObjCContainer());
Record.push_back(D->getAccess());
Record.push_back(D->isModulePrivate());
- Record.push_back(Writer.inferSubmoduleIDFromLocation(D->getLocation()));
+ Record.push_back(Writer.getSubmoduleID(D->getOwningModule()));
// If this declaration injected a name into a context different from its
// lexical context, and that context is an imported namespace, we need to
OpenPOWER on IntegriCloud