Check in the long promised SourceLocation rewrite. This lays the
ground work for implementing #line, and fixes the "out of macro ID's"
problem.
There is nothing particularly tricky about the code, other than the
very performance sensitive SourceManager::getFileID() method.
llvm-svn: 62978
diff --git a/clang/lib/Lex/ScratchBuffer.cpp b/clang/lib/Lex/ScratchBuffer.cpp
index bef81ca..695a536 100644
--- a/clang/lib/Lex/ScratchBuffer.cpp
+++ b/clang/lib/Lex/ScratchBuffer.cpp
@@ -50,7 +50,7 @@
SourceLocation ScratchBuffer::getToken(const char *Buf, unsigned Len,
SourceLocation SourceLoc) {
// Map the physloc to the specified sourceloc.
- return SourceMgr.getInstantiationLoc(getToken(Buf, Len), SourceLoc);
+ return SourceMgr.createInstantiationLoc(getToken(Buf, Len), SourceLoc, Len);
}
void ScratchBuffer::AllocScratchBuffer(unsigned RequestLen) {