mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-12 14:06:36 +00:00
Rename AbstractModuleProvider -> ModuleProvider, to match the header file name,
and because, while the class used by the interface is abstract, the actual concept is not. llvm-svn: 8850
This commit is contained in:
parent
7a9db7a722
commit
def80d731a
@ -18,14 +18,12 @@
|
||||
|
||||
/// getBytecodeModuleProvider - lazy function-at-a-time loading from a file
|
||||
///
|
||||
AbstractModuleProvider*
|
||||
getBytecodeModuleProvider(const std::string &Filename);
|
||||
ModuleProvider *getBytecodeModuleProvider(const std::string &Filename);
|
||||
|
||||
/// getBytecodeBufferModuleProvider - lazy function-at-a-time loading from a
|
||||
/// buffer
|
||||
///
|
||||
AbstractModuleProvider*
|
||||
getBytecodeBufferModuleProvider(const unsigned char *Buffer,
|
||||
ModuleProvider *getBytecodeBufferModuleProvider(const unsigned char *Buffer,
|
||||
unsigned BufferSize,
|
||||
const std::string &ModuleID="");
|
||||
|
||||
|
@ -14,13 +14,13 @@
|
||||
class Function;
|
||||
class Module;
|
||||
|
||||
class AbstractModuleProvider {
|
||||
class ModuleProvider {
|
||||
protected:
|
||||
Module *TheModule;
|
||||
AbstractModuleProvider();
|
||||
ModuleProvider();
|
||||
|
||||
public:
|
||||
virtual ~AbstractModuleProvider();
|
||||
virtual ~ModuleProvider();
|
||||
|
||||
/// getModule - returns the module this provider is encapsulating.
|
||||
///
|
||||
|
@ -43,7 +43,7 @@ struct LazyFunctionInfo {
|
||||
unsigned FunctionSlot;
|
||||
};
|
||||
|
||||
class BytecodeParser : public AbstractModuleProvider {
|
||||
class BytecodeParser : public ModuleProvider {
|
||||
BytecodeParser(const BytecodeParser &); // DO NOT IMPLEMENT
|
||||
void operator=(const BytecodeParser &); // DO NOT IMPLEMENT
|
||||
public:
|
||||
|
@ -156,7 +156,7 @@ BytecodeStdinReader::BytecodeStdinReader() {
|
||||
|
||||
/// getBytecodeBufferModuleProvider - lazy function-at-a-time loading from a
|
||||
/// buffer
|
||||
AbstractModuleProvider*
|
||||
ModuleProvider*
|
||||
getBytecodeBufferModuleProvider(const unsigned char *Buffer, unsigned Length,
|
||||
const std::string &ModuleID) {
|
||||
return new BytecodeBufferReader(Buffer, Length, ModuleID);
|
||||
@ -167,7 +167,7 @@ getBytecodeBufferModuleProvider(const unsigned char *Buffer, unsigned Length,
|
||||
Module *ParseBytecodeBuffer(const unsigned char *Buffer, unsigned Length,
|
||||
const std::string &ModuleID, std::string *ErrorStr){
|
||||
try {
|
||||
std::auto_ptr<AbstractModuleProvider>
|
||||
std::auto_ptr<ModuleProvider>
|
||||
AMP(getBytecodeBufferModuleProvider(Buffer, Length, ModuleID));
|
||||
return AMP->releaseModule();
|
||||
} catch (std::string &err) {
|
||||
@ -178,8 +178,7 @@ Module *ParseBytecodeBuffer(const unsigned char *Buffer, unsigned Length,
|
||||
|
||||
/// getBytecodeModuleProvider - lazy function-at-a-time loading from a file
|
||||
///
|
||||
AbstractModuleProvider*
|
||||
getBytecodeModuleProvider(const std::string &Filename) {
|
||||
ModuleProvider *getBytecodeModuleProvider(const std::string &Filename) {
|
||||
if (Filename != std::string("-")) // Read from a file...
|
||||
return new BytecodeFileReader(Filename);
|
||||
else // Read from stdin
|
||||
@ -190,8 +189,7 @@ getBytecodeModuleProvider(const std::string &Filename) {
|
||||
///
|
||||
Module *ParseBytecodeFile(const std::string &Filename, std::string *ErrorStr) {
|
||||
try {
|
||||
std::auto_ptr<AbstractModuleProvider>
|
||||
AMP(getBytecodeModuleProvider(Filename));
|
||||
std::auto_ptr<ModuleProvider> AMP(getBytecodeModuleProvider(Filename));
|
||||
return AMP->releaseModule();
|
||||
} catch (std::string &err) {
|
||||
if (ErrorStr) *ErrorStr = err;
|
||||
|
@ -9,17 +9,17 @@
|
||||
|
||||
/// ctor - always have a valid Module
|
||||
///
|
||||
AbstractModuleProvider::AbstractModuleProvider() : TheModule(0) { }
|
||||
ModuleProvider::ModuleProvider() : TheModule(0) { }
|
||||
|
||||
/// dtor - when we leave, we take our Module with us
|
||||
///
|
||||
AbstractModuleProvider::~AbstractModuleProvider() {
|
||||
ModuleProvider::~ModuleProvider() {
|
||||
delete TheModule;
|
||||
}
|
||||
|
||||
/// materializeFunction - make sure the given function is fully read.
|
||||
///
|
||||
void AbstractModuleProvider::materializeModule() {
|
||||
void ModuleProvider::materializeModule() {
|
||||
if (!TheModule) return;
|
||||
|
||||
for (Module::iterator i = TheModule->begin(), e = TheModule->end();
|
||||
|
Loading…
Reference in New Issue
Block a user