diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-12 05:48:23 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-12 05:48:23 +0000 |
commit | 8858159fb543624c61459f3afa219404bf3cf6fa (patch) | |
tree | aac154f261ad359c0bce13ea779444c4ce117929 /clang/lib/AST/Decl.cpp | |
parent | 277775b8afbc517731d4846d0fbd43ac7f8ac8d2 (diff) | |
download | bcm5719-llvm-8858159fb543624c61459f3afa219404bf3cf6fa.tar.gz bcm5719-llvm-8858159fb543624c61459f3afa219404bf3cf6fa.zip |
Fix a bug reduced from a crash when trying to use modules with libc++. We check
the linkage of functions and variables while merging declarations from modules,
and we don't necessarily have enough of the rest of the AST loaded at that
point to allow us to compute linkage, so serialize it instead.
llvm-svn: 174943
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r-- | clang/lib/AST/Decl.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 85ed3ba7db0..d6778ecf397 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -610,11 +610,8 @@ void NamedDecl::ClearLinkageCache() { } Linkage NamedDecl::getLinkage() const { - if (HasCachedLinkage) { - assert(Linkage(CachedLinkage) == - getLVForDecl(this, true).linkage()); + if (HasCachedLinkage) return Linkage(CachedLinkage); - } CachedLinkage = getLVForDecl(this, true).linkage(); HasCachedLinkage = 1; |