]> granicus.if.org Git - clang/commit
[modules] When creating a declaration, cache its owning module immediately
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 17 May 2017 00:24:14 +0000 (00:24 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 17 May 2017 00:24:14 +0000 (00:24 +0000)
commitbd2320f5d1153f2623f3104ea78e2cc5dbae6afb
treefd6fcd52c5bd30362b10fd32740c2e328d92cf9f
parent90199139dcd767a3bfc488590a8b27145bce7766
[modules] When creating a declaration, cache its owning module immediately
rather than waiting until it's queried.

Currently this is only applied to local submodule visibility mode, as we don't
yet allocate storage for the owning module in non-local-visibility modules
compilations.

This reinstates r302965, reverted in r303037, with a fix for the reported
crash, which occurred when reparenting a local declaration to be a child of
a hidden imported declaration (specifically during template instantiation).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303224 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
include/clang/AST/Decl.h
include/clang/AST/DeclBase.h
include/clang/Basic/LangOptions.h
include/clang/Sema/Sema.h
lib/AST/ASTDumper.cpp
lib/AST/Decl.cpp
lib/AST/DeclBase.cpp
lib/Sema/Sema.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaLookup.cpp
test/Modules/Inputs/submodule-visibility/b.h
test/Modules/Inputs/submodule-visibility/other.h
test/Modules/submodule-visibility.cpp