From 02495d80ef6cc38e48ea4ce7631ccd464e503a91 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 19 Jan 2009 06:57:37 +0000 Subject: [PATCH] Make some enums in SourceLocation private, remove a useless assertion from ScratchBuffer. llvm-svn: 62492 --- clang/include/clang/Basic/SourceLocation.h | 2 +- clang/lib/Lex/ScratchBuffer.cpp | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/clang/include/clang/Basic/SourceLocation.h b/clang/include/clang/Basic/SourceLocation.h index 2e0fb4d6709f..5c5290672322 100644 --- a/clang/include/clang/Basic/SourceLocation.h +++ b/clang/include/clang/Basic/SourceLocation.h @@ -65,7 +65,6 @@ private: class SourceLocation { unsigned ID; friend class SourceManager; -public: enum { // FileID Layout: // bit 31: 0 -> FileID, 1 -> MacroID (invalid for FileID) @@ -88,6 +87,7 @@ public: // Useful constants. ChunkSize = (1 << FilePosBits) }; +public: SourceLocation() : ID(0) {} // 0 is an invalid FileID. diff --git a/clang/lib/Lex/ScratchBuffer.cpp b/clang/lib/Lex/ScratchBuffer.cpp index ec07a71baf6e..bef81caac719 100644 --- a/clang/lib/Lex/ScratchBuffer.cpp +++ b/clang/lib/Lex/ScratchBuffer.cpp @@ -40,9 +40,6 @@ SourceLocation ScratchBuffer::getToken(const char *Buf, unsigned Len) { // Remember that we used these bytes. BytesUsed += Len; - assert(BytesUsed-Len < (1 << SourceLocation::FilePosBits) && - "Out of range file position!"); - return BufferStartLoc.getFileLocWithOffset(BytesUsed-Len); }