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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8850 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-10-04 20:14:59 +00:00
parent 9e460f23bb
commit 00413e3d63
5 changed files with 15 additions and 19 deletions

View File

@ -18,16 +18,14 @@
/// 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,
unsigned BufferSize,
const std::string &ModuleID = "");
ModuleProvider *getBytecodeBufferModuleProvider(const unsigned char *Buffer,
unsigned BufferSize,
const std::string &ModuleID="");
/// ParseBytecodeFile - Parse the given bytecode file
///

View File

@ -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.
///

View File

@ -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:

View File

@ -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;

View File

@ -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();