diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-17 08:45:21 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-17 08:45:21 +0000 |
commit | 3b4d5e955e819dd3a4bed37ea2e47d6e4cb05274 (patch) | |
tree | 0d9315c2e9e35acc7bb28187942346a41292cf45 /lib/Basic/SourceLocation.cpp | |
parent | 8350394c65b81bba3986dfe44ae17423873741de (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62427 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/SourceLocation.cpp')
-rw-r--r-- | lib/Basic/SourceLocation.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Basic/SourceLocation.cpp b/lib/Basic/SourceLocation.cpp index 84fac86a6d..dcfd547eec 100644 --- a/lib/Basic/SourceLocation.cpp +++ b/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); |