aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Reader/Reader.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-08-25 19:54:53 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-08-25 19:54:53 +0000
commit99655e16a6b0eafc8e18e73efe3ab27d2faf0a4a (patch)
tree1ce88ce7b68dbce9cd9d008db8234c1f52db86bb /lib/Bytecode/Reader/Reader.cpp
parentf3e4f0e615bb2c36c4a9d60bb908e08b76025c75 (diff)
For PR797:
Final commit for this bug. This removes the last EH holdouts in LLVM and turns off exception support by using the -fno-exceptions option. This leads to the following reduction in library and executable sizes: DEBUG BUILD RELEASE BUILD before after delta before after delta lib 162,328K 157,616K 4,712 17,864K 16,416K 1,448K bin 571,444K 557,156K 14,288 63,296K 56,996K 6,300K Debug Improvement: 19,000K (2.59%) Release Improvement: 7,748K (9.55%) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29882 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader/Reader.cpp')
-rw-r--r--lib/Bytecode/Reader/Reader.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index 4a0685b9f3..7b42fee915 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/lib/Bytecode/Reader/Reader.cpp
@@ -1943,14 +1943,18 @@ void BytecodeReader::ParseFunctionLazily() {
/// ParseAllFunctionBodies.
/// @see ParseAllFunctionBodies
/// @see ParseBytecode
-void BytecodeReader::ParseFunction(Function* Func) {
+bool BytecodeReader::ParseFunction(Function* Func, std::string* ErrMsg) {
+
+ if (setjmp(context))
+ return true;
+
// Find {start, end} pointers and slot in the map. If not there, we're done.
LazyFunctionMap::iterator Fi = LazyFunctionLoadMap.find(Func);
// Make sure we found it
if (Fi == LazyFunctionLoadMap.end()) {
error("Unrecognized function of type " + Func->getType()->getDescription());
- return;
+ return true;
}
BlockStart = At = Fi->second.Buf;
@@ -1960,6 +1964,7 @@ void BytecodeReader::ParseFunction(Function* Func) {
LazyFunctionLoadMap.erase(Fi);
this->ParseFunctionBody(Func);
+ return false;
}
/// The ParseAllFunctionBodies method parses through all the previously
@@ -1969,7 +1974,10 @@ void BytecodeReader::ParseFunction(Function* Func) {
/// the function definitions are located. This function uses that information
/// to materialize the functions.
/// @see ParseBytecode
-void BytecodeReader::ParseAllFunctionBodies() {
+bool BytecodeReader::ParseAllFunctionBodies(std::string* ErrMsg) {
+ if (setjmp(context))
+ return true;
+
LazyFunctionMap::iterator Fi = LazyFunctionLoadMap.begin();
LazyFunctionMap::iterator Fe = LazyFunctionLoadMap.end();
@@ -1981,7 +1989,7 @@ void BytecodeReader::ParseAllFunctionBodies() {
++Fi;
}
LazyFunctionLoadMap.clear();
-
+ return false;
}
/// Parse the global type list