From: Chris Lattner Date: Mon, 19 Jan 2009 06:57:37 +0000 (+0000) Subject: Make some enums in SourceLocation private, remove a useless assertion from ScratchBuffer. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ebac5e0dab6f99717e3ff169c45048966146b2e;p=clang Make some enums in SourceLocation private, remove a useless assertion from ScratchBuffer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62492 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/SourceLocation.h b/include/clang/Basic/SourceLocation.h index 2e0fb4d670..5c52906723 100644 --- a/include/clang/Basic/SourceLocation.h +++ b/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/lib/Lex/ScratchBuffer.cpp b/lib/Lex/ScratchBuffer.cpp index ec07a71baf..bef81caac7 100644 --- a/lib/Lex/ScratchBuffer.cpp +++ b/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); }