]> granicus.if.org Git - clang/commitdiff
add assert, use make_pair() instead of pair constructor
authorNico Weber <nicolasweber@gmx.de>
Sat, 9 Aug 2008 22:13:42 +0000 (22:13 +0000)
committerNico Weber <nicolasweber@gmx.de>
Sat, 9 Aug 2008 22:13:42 +0000 (22:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54596 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/SourceManager.h

index 425c3b08b2cfe388d1307e6e272dcb9bde665e25..7cb1f4c4bac85c27570cf10ff51875848891018a 100644 (file)
@@ -396,8 +396,10 @@ public:
     unsigned ChunkNo = FIDInfo->getChunkNo();
     unsigned Offset = Loc.getRawFilePos();
     Offset += (ChunkNo << SourceLocation::FilePosBits);
+
+    assert(Loc.getFileID() >= ChunkNo && "Unexpected offset");
     
-    return std::pair<unsigned,unsigned>(Loc.getFileID()-ChunkNo, Offset);
+    return std::make_pair(Loc.getFileID()-ChunkNo, Offset);
   }
     
   /// getFullFilePos - This (efficient) method returns the offset from the start