summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Reader/Reader.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-07-06 21:35:01 +0000
committerChris Lattner <sabre@nondot.org>2006-07-06 21:35:01 +0000
commit3d40daa4744ef1cbaa9a503216c03e82bef7a7e6 (patch)
tree59c3e1fc01f312d38b94a59937209ee8696de842 /llvm/lib/Bytecode/Reader/Reader.h
parent0e316b4dbfc20d2aa39d821b9c85fdac008f7614 (diff)
downloadbcm5719-llvm-3d40daa4744ef1cbaa9a503216c03e82bef7a7e6.tar.gz
bcm5719-llvm-3d40daa4744ef1cbaa9a503216c03e82bef7a7e6.zip
Change the ModuleProvider interface to not throw exceptions.
llvm-svn: 29024
Diffstat (limited to 'llvm/lib/Bytecode/Reader/Reader.h')
-rw-r--r--llvm/lib/Bytecode/Reader/Reader.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/llvm/lib/Bytecode/Reader/Reader.h b/llvm/lib/Bytecode/Reader/Reader.h
index ffc251b64ef..9cecf52436f 100644
--- a/llvm/lib/Bytecode/Reader/Reader.h
+++ b/llvm/lib/Bytecode/Reader/Reader.h
@@ -153,18 +153,33 @@ public:
/// implementation is identical to the ParseFunction method.
/// @see ParseFunction
/// @brief Make a specific function materialize.
- virtual void materializeFunction(Function *F) {
+ virtual bool materializeFunction(Function *F, std::string *ErrInfo = 0) {
LazyFunctionMap::iterator Fi = LazyFunctionLoadMap.find(F);
- if (Fi == LazyFunctionLoadMap.end()) return;
- ParseFunction(F);
+ if (Fi == LazyFunctionLoadMap.end()) return false;
+ try {
+ ParseFunction(F);
+ } catch (std::string &ErrStr) {
+ if (ErrInfo) *ErrInfo = ErrStr;
+ return true;
+ } catch (...) {
+ return true;
+ }
+ return false;
}
/// This method is abstract in the parent ModuleProvider class. Its
/// implementation is identical to ParseAllFunctionBodies.
/// @see ParseAllFunctionBodies
/// @brief Make the whole module materialize
- virtual Module* materializeModule() {
- ParseAllFunctionBodies();
+ virtual Module* materializeModule(std::string *ErrInfo = 0) {
+ try {
+ ParseAllFunctionBodies();
+ } catch (std::string &ErrStr) {
+ if (ErrInfo) *ErrInfo = ErrStr;
+ return 0;
+ } catch (...) {
+ return 0;
+ }
return TheModule;
}
OpenPOWER on IntegriCloud