aboutsummaryrefslogtreecommitdiff
path: root/tools/CIndex/CIndex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/CIndex/CIndex.cpp')
-rw-r--r--tools/CIndex/CIndex.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp
index cf33d7d8cd..493d4f2de6 100644
--- a/tools/CIndex/CIndex.cpp
+++ b/tools/CIndex/CIndex.cpp
@@ -980,8 +980,11 @@ const char *clang_getCursorSource(CXCursor C)
SourceManager &SourceMgr = ND->getASTContext().getSourceManager();
SourceLocation SLoc = getLocationFromCursor(C, SourceMgr, ND);
- if (SLoc.isFileID())
- return SourceMgr.getBufferName(SLoc);
+
+ if (SLoc.isFileID()) {
+ const char *bufferName = SourceMgr.getBufferName(SLoc);
+ return bufferName[0] == '<' ? NULL : bufferName;
+ }
// Retrieve the file in which the macro was instantiated, then provide that
// buffer name.