summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Reader/ReaderInternals.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-01-15 06:13:09 +0000
committerChris Lattner <sabre@nondot.org>2004-01-15 06:13:09 +0000
commitfaaf32db19ec78dd0c01f071c93cf86ae857c524 (patch)
tree17998eab651141e2084c7c6901b82ef1702e75bd /llvm/lib/Bytecode/Reader/ReaderInternals.h
parent1af644d9d6e2d7f3073d021aa2578966cc139e86 (diff)
downloadbcm5719-llvm-faaf32db19ec78dd0c01f071c93cf86ae857c524.tar.gz
bcm5719-llvm-faaf32db19ec78dd0c01f071c93cf86ae857c524.zip
Change all of the bytecode reader primitives to throw exceptions instead of
returning error codes. Because they don't return an error code, they can return the value read, which simplifies the code and makes the reader more efficient (yaay!). Also eliminate the special case code for little endian machines. llvm-svn: 10871
Diffstat (limited to 'llvm/lib/Bytecode/Reader/ReaderInternals.h')
-rw-r--r--llvm/lib/Bytecode/Reader/ReaderInternals.h16
1 files changed, 2 insertions, 14 deletions
diff --git a/llvm/lib/Bytecode/Reader/ReaderInternals.h b/llvm/lib/Bytecode/Reader/ReaderInternals.h
index 54a38e457b4..deb120672a1 100644
--- a/llvm/lib/Bytecode/Reader/ReaderInternals.h
+++ b/llvm/lib/Bytecode/Reader/ReaderInternals.h
@@ -214,23 +214,11 @@ struct ConstantPlaceHolderHelper : public ConstantExpr {
typedef PlaceholderDef<ConstantPlaceHolderHelper> ConstPHolder;
-// Some common errors we find
-static const std::string Error_readvbr = "read_vbr(): error reading.";
-static const std::string Error_read = "read(): error reading.";
-static const std::string Error_inputdata = "input_data(): error reading.";
-static const std::string Error_DestSlot = "No destination slot found.";
-
static inline void readBlock(const unsigned char *&Buf,
const unsigned char *EndBuf,
unsigned &Type, unsigned &Size) {
-#ifdef DEBUG_OUTPUT
- bool Result = read(Buf, EndBuf, Type) || read(Buf, EndBuf, Size);
- std::cerr << "StartLoc = " << ((unsigned)Buf & 4095)
- << " Type = " << Type << " Size = " << Size << "\n";
- if (Result) throw Error_read;
-#else
- if (read(Buf, EndBuf, Type) || read(Buf, EndBuf, Size)) throw Error_read;
-#endif
+ Type = read(Buf, EndBuf);
+ Size = read(Buf, EndBuf);
}
} // End llvm namespace
OpenPOWER on IntegriCloud