diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-07-07 03:40:27 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-07-07 03:40:27 +0000 |
commit | 8b86ef0b71900c64c0c2cfca54cac08a203a16a4 (patch) | |
tree | 00a59a871d38948d6b6e26785e9e29b56bb50e93 /include/clang/Basic/SourceManager.h | |
parent | d410e741e8085e109c1dc5886c0acea88a4ca0f4 (diff) |
Fix bug in SourceManager::getDecomposedInstantiationLocSlowCase.
It would add up relative (decomposed) offsets like in getDecomposedSpellingLocSlowCase, but while
it makes sense to preserve the offset among lexed spelling locations, it doesn't make
sense to add anything to the offset of the instantiation location. The instantiation
location will be the same regardless of the relative offset in the tokens that were
instantiated.
This bug didn't actually affect anything because, currently, in practice we never create macro
locations with relative offset greater than 0.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134586 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index f2a8bf3515..05551e5319 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -721,7 +721,7 @@ public: if (Loc.isFileID()) return std::make_pair(FID, Offset); - return getDecomposedInstantiationLocSlowCase(E, Offset); + return getDecomposedInstantiationLocSlowCase(E); } /// getDecomposedSpellingLoc - Decompose the specified location into a raw @@ -989,8 +989,7 @@ private: SourceLocation getSpellingLocSlowCase(SourceLocation Loc) const; std::pair<FileID, unsigned> - getDecomposedInstantiationLocSlowCase(const SrcMgr::SLocEntry *E, - unsigned Offset) const; + getDecomposedInstantiationLocSlowCase(const SrcMgr::SLocEntry *E) const; std::pair<FileID, unsigned> getDecomposedSpellingLocSlowCase(const SrcMgr::SLocEntry *E, unsigned Offset) const; |