From 6c47a9b9779216ef24526c064d5b6ab0db0b5009 Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Tue, 6 Jul 2010 01:20:49 +0000 Subject: [PATCH] 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 --- lib/Index/Entity.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.40.0