aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceLocation.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-17 08:45:21 +0000
committerChris Lattner <sabre@nondot.org>2009-01-17 08:45:21 +0000
commit71dc14b9f0ea58d1c113ab7226bc67793347e4a3 (patch)
treebe04630aeca6bdb5544c8800baa930b929109f7b /clang/lib/Basic/SourceLocation.cpp
parent5509d533f6843a977e8f11819b747f6cd09f3273 (diff)
downloadllvm-71dc14b9f0ea58d1c113ab7226bc67793347e4a3.zip
llvm-71dc14b9f0ea58d1c113ab7226bc67793347e4a3.tar.gz
llvm-71dc14b9f0ea58d1c113ab7226bc67793347e4a3.tar.bz2
Rename SourceLocation::getFileID to getChunkID, because it returns
the chunk ID not the file ID. This exposes problems in TextDiagnosticPrinter where it should have been using the canonical file ID but wasn't. Fix these along the way. llvm-svn: 62427
Diffstat (limited to 'clang/lib/Basic/SourceLocation.cpp')
-rw-r--r--clang/lib/Basic/SourceLocation.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Basic/SourceLocation.cpp b/clang/lib/Basic/SourceLocation.cpp
index 84fac86..dcfd547 100644
--- a/clang/lib/Basic/SourceLocation.cpp
+++ b/clang/lib/Basic/SourceLocation.cpp
@@ -37,6 +37,12 @@ SourceRange SourceRange::ReadVal(llvm::Deserializer& D) {
return SourceRange(A,B);
}
+FileID FullSourceLoc::getFileID() const {
+ assert(isValid());
+ return SrcMgr->getCanonicalFileID(*this);
+}
+
+
FullSourceLoc FullSourceLoc::getInstantiationLoc() const {
assert(isValid());
return FullSourceLoc(SrcMgr->getInstantiationLoc(*this), *SrcMgr);