[cfe-commits] r80813 - /cfe/trunk/tools/CIndex/CIndex.cpp
Steve Naroff
snaroff at apple.com
Wed Sep 2 11:58:53 PDT 2009
Author: snaroff
Date: Wed Sep 2 13:58:52 2009
New Revision: 80813
URL: http://llvm.org/viewvc/llvm-project?rev=80813&view=rev
Log:
Fix some newly added bugs uncovered by the RELEASE build.
Modified:
cfe/trunk/tools/CIndex/CIndex.cpp
Modified: cfe/trunk/tools/CIndex/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.cpp?rev=80813&r1=80812&r2=80813&view=diff
==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndex.cpp Wed Sep 2 13:58:52 2009
@@ -253,10 +253,12 @@
if (clang_isReference(C.kind)) {
switch (C.kind) {
- case CXCursor_ObjCSuperClassRef:
+ case CXCursor_ObjCSuperClassRef:
+ {
ObjCInterfaceDecl *OID = dyn_cast<ObjCInterfaceDecl>(ND);
assert(OID && "clang_getCursorLine(): Missing interface decl");
return OID->getSuperClass()->getIdentifier()->getName();
+ }
default:
return "<not implemented>";
}
@@ -326,24 +328,23 @@
static SourceLocation getLocationFromCursor(CXCursor C,
SourceManager &SourceMgr,
NamedDecl *ND) {
- SourceLocation SLoc;
if (clang_isReference(C.kind)) {
switch (C.kind) {
case CXCursor_ObjCSuperClassRef:
+ {
ObjCInterfaceDecl *OID = dyn_cast<ObjCInterfaceDecl>(ND);
assert(OID && "clang_getCursorLine(): Missing interface decl");
- SLoc = OID->getSuperClassLoc();
- break;
+ return OID->getSuperClassLoc();
+ }
default:
- break;
+ return SourceLocation();
}
} else { // We have a declaration or a definition.
- SLoc = ND->getLocation();
+ SourceLocation SLoc = ND->getLocation();
if (SLoc.isInvalid())
return SourceLocation();
- SLoc = SourceMgr.getSpellingLoc(SLoc); // handles macro instantiations.
+ return SourceMgr.getSpellingLoc(SLoc); // handles macro instantiations.
}
- return SLoc;
}
unsigned clang_getCursorLine(CXCursor C)
More information about the cfe-commits
mailing list