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 | f894cfb44f0c5661f02ea09ca93115389e5dc65e (patch) | |
tree | 6bc6e0eb6eed83488044772acc66d32a340db09f /clang/lib/Index/Entity.cpp | |
parent | ceddafb846b518d0b9e8841305d856804a46c6b6 (diff) | |
download | bcm5719-llvm-f894cfb44f0c5661f02ea09ca93115389e5dc65e.tar.gz bcm5719-llvm-f894cfb44f0c5661f02ea09ca93115389e5dc65e.zip |
Local variables have no linkage, make invalid Entities.
llvm-svn: 107630
Diffstat (limited to 'clang/lib/Index/Entity.cpp')
-rw-r--r-- | clang/lib/Index/Entity.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Index/Entity.cpp b/clang/lib/Index/Entity.cpp index 8178fbe7ab4..b6fb17fc2b1 100644 --- a/clang/lib/Index/Entity.cpp +++ b/clang/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); |