]> granicus.if.org Git - clang/commit
Set MustBuildLookupTable on PrimaryContext in ExternalASTMerger
authorRaphael Isemann <teemperor@gmail.com>
Thu, 29 Nov 2018 13:50:30 +0000 (13:50 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Thu, 29 Nov 2018 13:50:30 +0000 (13:50 +0000)
commitf04d905d33026e33bc1d0928497157f83844f3cd
treee5ba916c4575aa528769ee6196fd7510f9f487d1
parent2709c8b804eb38dbdc8ae05b8fcf4f95c01b4102
Set MustBuildLookupTable on PrimaryContext in ExternalASTMerger

Summary:
`MustBuildLookupTable` must always be called on a primary context as we otherwise
trigger an assert, but we don't ensure that this will always happen in our code right now.

This patch explicitly requests the primary context when doing this call as this shouldn't break
anything (as calling `getPrimaryContext` on a context which is its own primary context is a no-op)
but will catch these rare cases where we somehow operate on a declaration context that is
not its own primary context.

See also D54863.

Reviewers: martong, a.sidorin, shafik

Reviewed By: martong

Subscribers: davide, rnkovacs, cfe-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D54898

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347863 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/ExternalASTMerger.cpp