diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-07-06 01:20:49 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-07-06 01:20:49 +0000 |
commit | 6c47a9b9779216ef24526c064d5b6ab0db0b5009 (patch) | |
tree | 985f21fae02679b7cbb62fcf537f50f56f639f0d /lib/Index/Entity.cpp | |
parent | 9282688a296b306c4ae2d115f55101647056d1da (diff) |
Local variables have no linkage, make invalid Entities.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107630 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Index/Entity.cpp')
-rw-r--r-- | lib/Index/Entity.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Index/Entity.cpp b/lib/Index/Entity.cpp index 8178fbe7ab..b6fb17fc2b 100644 --- a/lib/Index/Entity.cpp +++ b/lib/Index/Entity.cpp @@ -111,6 +111,10 @@ Entity EntityGetter::VisitNamedDecl(NamedDecl *D) { } Entity EntityGetter::VisitVarDecl(VarDecl *D) { + // Local variables have no linkage, make invalid Entities. + if (D->hasLocalStorage()) + return Entity(); + // If it's static it cannot be referred to by another translation unit. if (D->getStorageClass() == VarDecl::Static) return Entity(D); |