diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-05-25 17:16:20 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-05-25 17:16:20 +0000 |
commit | 50df3a02be200a71aac0a680816f26577b46c03e (patch) | |
tree | e359b9dd1f88ba2d3a59a7515733507b998f4119 /clang/tools/libclang/CIndex.cpp | |
parent | 5bed56d2f543da9e5cb0174e60eed0225350a3be (diff) | |
download | bcm5719-llvm-50df3a02be200a71aac0a680816f26577b46c03e.tar.gz bcm5719-llvm-50df3a02be200a71aac0a680816f26577b46c03e.zip |
Fix linkage computation for derived types in inline functions.
John noticed that the fix for pr15930 (r181981) didn't handle indirect
uses of local types. For example, a pointer to local struct, or a
function that returns it.
One way to implement this would be to recursively look for local
types. This would look a lot like the linkage computation itself for
types.
To avoid code duplication and utilize the existing linkage cache, this
patch just makes the computation of "type with no linkage but
externally visible because it is from an inline function" part of the
linkage computation itself.
llvm-svn: 182711
Diffstat (limited to 'clang/tools/libclang/CIndex.cpp')
-rw-r--r-- | clang/tools/libclang/CIndex.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index dbef6209ec8..dacd46e96fc 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -5687,7 +5687,8 @@ CXLinkageKind clang_getCursorLinkage(CXCursor cursor) { const Decl *D = cxcursor::getCursorDecl(cursor); if (const NamedDecl *ND = dyn_cast_or_null<NamedDecl>(D)) switch (ND->getLinkageInternal()) { - case NoLinkage: return CXLinkage_NoLinkage; + case NoLinkage: + case VisibleNoLinkage: return CXLinkage_NoLinkage; case InternalLinkage: return CXLinkage_Internal; case UniqueExternalLinkage: return CXLinkage_UniqueExternal; case ExternalLinkage: return CXLinkage_External; |