summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-06-07 17:57:59 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-06-07 17:57:59 +0000
commitfe68302fe819b28165a9933ce7ef8f465609da8b (patch)
treec52a0302350c12bcdf6262777169f3274cde5d35 /clang/lib/Basic/SourceManager.cpp
parent158d8069ad3cf660dceac4e4e1b150f5cb03289c (diff)
downloadbcm5719-llvm-fe68302fe819b28165a9933ce7ef8f465609da8b.tar.gz
bcm5719-llvm-fe68302fe819b28165a9933ce7ef8f465609da8b.zip
Thread the 'Invalid' out parameter through SourceManager::getSLocEntry() and callees of SourceManager::getSLocEntryByID().
Also add an 'Invalid' check in SourceManager::computeMacroArgsCache(). llvm-svn: 183538
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r--clang/lib/Basic/SourceManager.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index 0de5129a358..2e3fb7db412 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -1808,7 +1808,10 @@ void SourceManager::computeMacroArgsCache(MacroArgsMap *&CachePtr,
return;
}
- const SrcMgr::SLocEntry &Entry = getSLocEntryByID(ID);
+ bool Invalid = false;
+ const SrcMgr::SLocEntry &Entry = getSLocEntryByID(ID, &Invalid);
+ if (Invalid)
+ return;
if (Entry.isFile()) {
SourceLocation IncludeLoc = Entry.getFile().getIncludeLoc();
if (IncludeLoc.isInvalid())
OpenPOWER on IntegriCloud