mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-27 13:30:05 +00:00
Use error_code in Module::materializeAll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199269 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
70aa0556d4
commit
06a3bddb36
@ -22,6 +22,7 @@
|
||||
#include "llvm/IR/Metadata.h"
|
||||
#include "llvm/Support/CBindingWrapping.h"
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
#include "llvm/Support/system_error.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
@ -450,11 +451,8 @@ public:
|
||||
/// materialized lazily. If !isDematerializable(), this method is a noop.
|
||||
void Dematerialize(GlobalValue *GV);
|
||||
|
||||
/// MaterializeAll - Make sure all GlobalValues in this Module are fully read.
|
||||
/// If the module is corrupt, this returns true and fills in the optional
|
||||
/// string with information about the problem. If successful, this returns
|
||||
/// false.
|
||||
bool MaterializeAll(std::string *ErrInfo = 0);
|
||||
/// Make sure all GlobalValues in this Module are fully read.
|
||||
error_code materializeAll();
|
||||
|
||||
/// MaterializeAllPermanently - Make sure all GlobalValues in this Module are
|
||||
/// fully read and clear the Materializer. If the module is corrupt, this
|
||||
|
@ -377,20 +377,18 @@ void Module::Dematerialize(GlobalValue *GV) {
|
||||
return Materializer->Dematerialize(GV);
|
||||
}
|
||||
|
||||
bool Module::MaterializeAll(std::string *ErrInfo) {
|
||||
error_code Module::materializeAll() {
|
||||
if (!Materializer)
|
||||
return false;
|
||||
error_code EC = Materializer->MaterializeModule(this);
|
||||
if (!EC)
|
||||
return false;
|
||||
if (ErrInfo)
|
||||
*ErrInfo = EC.message();
|
||||
return true;
|
||||
return error_code::success();
|
||||
return Materializer->MaterializeModule(this);
|
||||
}
|
||||
|
||||
bool Module::MaterializeAllPermanently(std::string *ErrInfo) {
|
||||
if (MaterializeAll(ErrInfo))
|
||||
if (error_code EC = materializeAll()) {
|
||||
if (ErrInfo)
|
||||
*ErrInfo = EC.message();
|
||||
return true;
|
||||
}
|
||||
Materializer.reset();
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user