[cfe-commits] r54596 - /cfe/trunk/include/clang/Basic/SourceManager.h
Nico Weber
nicolasweber at gmx.de
Sat Aug 9 15:13:42 PDT 2008
Author: nico
Date: Sat Aug 9 17:13:42 2008
New Revision: 54596
URL: http://llvm.org/viewvc/llvm-project?rev=54596&view=rev
Log:
add assert, use make_pair() instead of pair constructor
Modified:
cfe/trunk/include/clang/Basic/SourceManager.h
Modified: cfe/trunk/include/clang/Basic/SourceManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceManager.h?rev=54596&r1=54595&r2=54596&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/SourceManager.h (original)
+++ cfe/trunk/include/clang/Basic/SourceManager.h Sat Aug 9 17:13:42 2008
@@ -396,8 +396,10 @@
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
More information about the cfe-commits
mailing list