mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-04 05:31:51 +00:00
Fine grainify namespacification, #include file that defines the interface!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10081 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f2586d13d5
commit
deab9a7ae5
@ -12,6 +12,7 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#include "llvm/Bytecode/Reader.h"
|
||||||
#include "ReaderInternals.h"
|
#include "ReaderInternals.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/Instructions.h"
|
#include "llvm/Instructions.h"
|
||||||
@ -20,8 +21,7 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include "Config/unistd.h"
|
#include "Config/unistd.h"
|
||||||
#include "Config/sys/mman.h"
|
#include "Config/sys/mman.h"
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// BytecodeFileReader - Read from an mmap'able file descriptor.
|
// BytecodeFileReader - Read from an mmap'able file descriptor.
|
||||||
@ -258,15 +258,17 @@ static ModuleProvider *CheckVarargs(ModuleProvider *MP) {
|
|||||||
/// getBytecodeBufferModuleProvider - lazy function-at-a-time loading from a
|
/// getBytecodeBufferModuleProvider - lazy function-at-a-time loading from a
|
||||||
/// buffer
|
/// buffer
|
||||||
ModuleProvider*
|
ModuleProvider*
|
||||||
getBytecodeBufferModuleProvider(const unsigned char *Buffer, unsigned Length,
|
llvm::getBytecodeBufferModuleProvider(const unsigned char *Buffer,
|
||||||
const std::string &ModuleID) {
|
unsigned Length,
|
||||||
|
const std::string &ModuleID) {
|
||||||
return CheckVarargs(new BytecodeBufferReader(Buffer, Length, ModuleID));
|
return CheckVarargs(new BytecodeBufferReader(Buffer, Length, ModuleID));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ParseBytecodeBuffer - Parse a given bytecode buffer
|
/// ParseBytecodeBuffer - Parse a given bytecode buffer
|
||||||
///
|
///
|
||||||
Module *ParseBytecodeBuffer(const unsigned char *Buffer, unsigned Length,
|
Module *llvm::ParseBytecodeBuffer(const unsigned char *Buffer, unsigned Length,
|
||||||
const std::string &ModuleID, std::string *ErrorStr){
|
const std::string &ModuleID,
|
||||||
|
std::string *ErrorStr){
|
||||||
try {
|
try {
|
||||||
std::auto_ptr<ModuleProvider>
|
std::auto_ptr<ModuleProvider>
|
||||||
AMP(getBytecodeBufferModuleProvider(Buffer, Length, ModuleID));
|
AMP(getBytecodeBufferModuleProvider(Buffer, Length, ModuleID));
|
||||||
@ -279,7 +281,7 @@ Module *ParseBytecodeBuffer(const unsigned char *Buffer, unsigned Length,
|
|||||||
|
|
||||||
/// getBytecodeModuleProvider - lazy function-at-a-time loading from a file
|
/// getBytecodeModuleProvider - lazy function-at-a-time loading from a file
|
||||||
///
|
///
|
||||||
ModuleProvider *getBytecodeModuleProvider(const std::string &Filename) {
|
ModuleProvider *llvm::getBytecodeModuleProvider(const std::string &Filename) {
|
||||||
if (Filename != std::string("-")) // Read from a file...
|
if (Filename != std::string("-")) // Read from a file...
|
||||||
return CheckVarargs(new BytecodeFileReader(Filename));
|
return CheckVarargs(new BytecodeFileReader(Filename));
|
||||||
else // Read from stdin
|
else // Read from stdin
|
||||||
@ -288,7 +290,8 @@ ModuleProvider *getBytecodeModuleProvider(const std::string &Filename) {
|
|||||||
|
|
||||||
/// ParseBytecodeFile - Parse the given bytecode file
|
/// ParseBytecodeFile - Parse the given bytecode file
|
||||||
///
|
///
|
||||||
Module *ParseBytecodeFile(const std::string &Filename, std::string *ErrorStr) {
|
Module *llvm::ParseBytecodeFile(const std::string &Filename,
|
||||||
|
std::string *ErrorStr) {
|
||||||
try {
|
try {
|
||||||
std::auto_ptr<ModuleProvider> AMP(getBytecodeModuleProvider(Filename));
|
std::auto_ptr<ModuleProvider> AMP(getBytecodeModuleProvider(Filename));
|
||||||
return AMP->releaseModule();
|
return AMP->releaseModule();
|
||||||
@ -298,4 +301,3 @@ Module *ParseBytecodeFile(const std::string &Filename, std::string *ErrorStr) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user