[cfe-commits] r38598 - /cfe/cfe/trunk/Lex/ScratchBuffer.cpp

sabre at cs.uiuc.edu sabre at cs.uiuc.edu
Wed Jul 11 09:23:04 PDT 2007


Author: sabre
Date: Wed Jul 11 11:23:04 2007
New Revision: 38598

URL: http://llvm.org/viewvc/llvm-project?rev=38598&view=rev
Log:
Use a new helper to do this much more simply.

Modified:
    cfe/cfe/trunk/Lex/ScratchBuffer.cpp

Modified: cfe/cfe/trunk/Lex/ScratchBuffer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/ScratchBuffer.cpp?rev=38598&r1=38597&r2=38598&view=diff

==============================================================================
--- cfe/cfe/trunk/Lex/ScratchBuffer.cpp (original)
+++ cfe/cfe/trunk/Lex/ScratchBuffer.cpp Wed Jul 11 11:23:04 2007
@@ -53,12 +53,8 @@
 /// gives a virtual location that the token will appear to be from.
 SourceLocation ScratchBuffer::getToken(const char *Buf, unsigned Len,
                                        SourceLocation SourceLoc) {
-  SourceLocation PhysLoc = getToken(Buf, Len);
-
   // Map the physloc to the specified sourceloc.
-  unsigned InstantiationFileID =
-    SourceMgr.createFileIDForMacroExp(SourceLoc, PhysLoc.getFileID());
-  return SourceLocation(InstantiationFileID, PhysLoc.getRawFilePos());
+  return SourceMgr.getInstantiationLoc(getToken(Buf, Len), SourceLoc);
 }
 
 void ScratchBuffer::AllocScratchBuffer(unsigned RequestLen) {





More information about the cfe-commits mailing list