summaryrefslogtreecommitdiffstats
path: root/tools/libclang/IndexingContext.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
committerdim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
commit952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch)
treedf8df0b0067b381eab470a3b8f28d14a552a6340 /tools/libclang/IndexingContext.cpp
parentea266cad53e3d49771fa38103913d3ec7a166694 (diff)
downloadFreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip
FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'tools/libclang/IndexingContext.cpp')
-rw-r--r--tools/libclang/IndexingContext.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/tools/libclang/IndexingContext.cpp b/tools/libclang/IndexingContext.cpp
index 14b430c..41ed6ea 100644
--- a/tools/libclang/IndexingContext.cpp
+++ b/tools/libclang/IndexingContext.cpp
@@ -10,6 +10,7 @@
#include "IndexingContext.h"
#include "CIndexDiagnostic.h"
#include "CXTranslationUnit.h"
+#include "clang/AST/Attr.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/Frontend/ASTUnit.h"
@@ -93,17 +94,19 @@ AttrListInfo::AttrListInfo(const Decl *D, IndexingContext &IdxCtx)
const IBOutletCollectionAttr *
IBAttr = cast<IBOutletCollectionAttr>(IBInfo.A);
+ SourceLocation InterfaceLocStart =
+ IBAttr->getInterfaceLoc()->getTypeLoc().getLocStart();
IBInfo.IBCollInfo.attrInfo = &IBInfo;
- IBInfo.IBCollInfo.classLoc = IdxCtx.getIndexLoc(IBAttr->getInterfaceLoc());
+ IBInfo.IBCollInfo.classLoc = IdxCtx.getIndexLoc(InterfaceLocStart);
IBInfo.IBCollInfo.objcClass = 0;
IBInfo.IBCollInfo.classCursor = clang_getNullCursor();
QualType Ty = IBAttr->getInterface();
- if (const ObjCInterfaceType *InterTy = Ty->getAs<ObjCInterfaceType>()) {
- if (const ObjCInterfaceDecl *InterD = InterTy->getInterface()) {
+ if (const ObjCObjectType *ObjectTy = Ty->getAs<ObjCObjectType>()) {
+ if (const ObjCInterfaceDecl *InterD = ObjectTy->getInterface()) {
IdxCtx.getEntityInfo(InterD, IBInfo.ClassInfo, SA);
IBInfo.IBCollInfo.objcClass = &IBInfo.ClassInfo;
- IBInfo.IBCollInfo.classCursor = MakeCursorObjCClassRef(InterD,
- IBAttr->getInterfaceLoc(), IdxCtx.CXTU);
+ IBInfo.IBCollInfo.classCursor =
+ MakeCursorObjCClassRef(InterD, InterfaceLocStart, IdxCtx.CXTU);
}
}
}
@@ -210,11 +213,13 @@ bool IndexingContext::isFunctionLocalDecl(const Decl *D) {
return false;
if (const NamedDecl *ND = dyn_cast<NamedDecl>(D)) {
- switch (ND->getLinkage()) {
+ switch (ND->getFormalLinkage()) {
case NoLinkage:
+ case VisibleNoLinkage:
case InternalLinkage:
return true;
case UniqueExternalLinkage:
+ llvm_unreachable("Not a sema linkage");
case ExternalLinkage:
return false;
}
@@ -378,14 +383,14 @@ bool IndexingContext::handleFunction(const FunctionDecl *D) {
isContainer = false;
}
- DeclInfo DInfo(!D->isFirstDeclaration(), isDef, isContainer);
+ DeclInfo DInfo(!D->isFirstDecl(), isDef, isContainer);
if (isSkipped)
DInfo.flags |= CXIdxDeclFlag_Skipped;
return handleDecl(D, D->getLocation(), getCursor(D), DInfo);
}
bool IndexingContext::handleVar(const VarDecl *D) {
- DeclInfo DInfo(!D->isFirstDeclaration(), D->isThisDeclarationADefinition(),
+ DeclInfo DInfo(!D->isFirstDecl(), D->isThisDeclarationADefinition(),
/*isContainer=*/false);
return handleDecl(D, D->getLocation(), getCursor(D), DInfo);
}
@@ -412,13 +417,13 @@ bool IndexingContext::handleTagDecl(const TagDecl *D) {
if (const CXXRecordDecl *CXXRD = dyn_cast<CXXRecordDecl>(D))
return handleCXXRecordDecl(CXXRD, D);
- DeclInfo DInfo(!D->isFirstDeclaration(), D->isThisDeclarationADefinition(),
+ DeclInfo DInfo(!D->isFirstDecl(), D->isThisDeclarationADefinition(),
D->isThisDeclarationADefinition());
return handleDecl(D, D->getLocation(), getCursor(D), DInfo);
}
bool IndexingContext::handleTypedefName(const TypedefNameDecl *D) {
- DeclInfo DInfo(!D->isFirstDeclaration(), /*isDefinition=*/true,
+ DeclInfo DInfo(!D->isFirstDecl(), /*isDefinition=*/true,
/*isContainer=*/false);
return handleDecl(D, D->getLocation(), getCursor(D), DInfo);
}
OpenPOWER on IntegriCloud