summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-30 19:45:53 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-30 19:45:53 +0000
commit0925fbc3fd30f2654533bc54af7a6cc5d6b1c873 (patch)
tree0ffde17c70ac246bc0f83461211467f9655c8d05
parentd6c5391cd98a967a9a4038541d2842aea39b6d8f (diff)
downloadbcm5719-llvm-0925fbc3fd30f2654533bc54af7a6cc5d6b1c873.tar.gz
bcm5719-llvm-0925fbc3fd30f2654533bc54af7a6cc5d6b1c873.zip
Teach clang_getLocation() to cope with a NULL file argument.
llvm-svn: 102748
-rw-r--r--clang/tools/CIndex/CIndex.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/tools/CIndex/CIndex.cpp b/clang/tools/CIndex/CIndex.cpp
index 6221a615aa7..f9f735113f7 100644
--- a/clang/tools/CIndex/CIndex.cpp
+++ b/clang/tools/CIndex/CIndex.cpp
@@ -1296,9 +1296,9 @@ CXSourceLocation clang_getLocation(CXTranslationUnit tu,
CXFile file,
unsigned line,
unsigned column) {
- if (!tu)
+ if (!tu || !file)
return clang_getNullLocation();
-
+
ASTUnit *CXXUnit = static_cast<ASTUnit *>(tu);
SourceLocation SLoc
= CXXUnit->getSourceManager().getLocation(
OpenPOWER on IntegriCloud