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
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 @@
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);