diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-11-05 19:36:34 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-11-05 19:36:34 +0000 |
commit | af9e8e60ae5118066e49730ae5a96aadf3a8f624 (patch) | |
tree | cf9035f11cf8a5fd2824f21a38d6c2395ff109f5 /lib/IR | |
parent | 3ff3a8aa7511bede13e836303a083af37fec4f4e (diff) | |
download | external_llvm-af9e8e60ae5118066e49730ae5a96aadf3a8f624.zip external_llvm-af9e8e60ae5118066e49730ae5a96aadf3a8f624.tar.gz external_llvm-af9e8e60ae5118066e49730ae5a96aadf3a8f624.tar.bz2 |
Use error_code in GVMaterializer.
They just propagate out the bitcode reader error, so we don't need a new enum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194091 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR')
-rw-r--r-- | lib/IR/Module.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/IR/Module.cpp b/lib/IR/Module.cpp index 58115ef..3dd1f7e 100644 --- a/lib/IR/Module.cpp +++ b/lib/IR/Module.cpp @@ -401,9 +401,15 @@ bool Module::isDematerializable(const GlobalValue *GV) const { } bool Module::Materialize(GlobalValue *GV, std::string *ErrInfo) { - if (Materializer) - return Materializer->Materialize(GV, ErrInfo); - return false; + if (!Materializer) + return false; + + error_code EC = Materializer->Materialize(GV); + if (!EC) + return false; + if (ErrInfo) + *ErrInfo = EC.message(); + return true; } void Module::Dematerialize(GlobalValue *GV) { @@ -414,7 +420,12 @@ void Module::Dematerialize(GlobalValue *GV) { bool Module::MaterializeAll(std::string *ErrInfo) { if (!Materializer) return false; - return Materializer->MaterializeModule(this, ErrInfo); + error_code EC = Materializer->MaterializeModule(this); + if (!EC) + return false; + if (ErrInfo) + *ErrInfo = EC.message(); + return true; } bool Module::MaterializeAllPermanently(std::string *ErrInfo) { |