forked from OSchip/llvm-project
parent
3d571ff970
commit
3a3480fa53
|
@ -102,7 +102,6 @@ bool MSILWriter::runOnFunction(Function &F) {
|
||||||
|
|
||||||
bool MSILWriter::doInitialization(Module &M) {
|
bool MSILWriter::doInitialization(Module &M) {
|
||||||
ModulePtr = &M;
|
ModulePtr = &M;
|
||||||
Mang = new Mangler(M);
|
|
||||||
Out << ".assembly extern mscorlib {}\n";
|
Out << ".assembly extern mscorlib {}\n";
|
||||||
Out << ".assembly MSIL {}\n\n";
|
Out << ".assembly MSIL {}\n\n";
|
||||||
Out << "// External\n";
|
Out << "// External\n";
|
||||||
|
@ -118,7 +117,6 @@ bool MSILWriter::doInitialization(Module &M) {
|
||||||
|
|
||||||
|
|
||||||
bool MSILWriter::doFinalization(Module &M) {
|
bool MSILWriter::doFinalization(Module &M) {
|
||||||
delete Mang;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +230,7 @@ bool MSILWriter::isZeroValue(const Value* V) {
|
||||||
std::string MSILWriter::getValueName(const Value* V) {
|
std::string MSILWriter::getValueName(const Value* V) {
|
||||||
std::string Name;
|
std::string Name;
|
||||||
if (const GlobalValue *GV = dyn_cast<GlobalValue>(V))
|
if (const GlobalValue *GV = dyn_cast<GlobalValue>(V))
|
||||||
Name = Mang->getMangledName(GV);
|
Name = GV->getName();
|
||||||
else {
|
else {
|
||||||
unsigned &No = AnonValueNumbers[V];
|
unsigned &No = AnonValueNumbers[V];
|
||||||
if (No == 0) No = ++NextAnonValueNumber;
|
if (No == 0) No = ++NextAnonValueNumber;
|
||||||
|
@ -259,7 +257,7 @@ std::string MSILWriter::getLabelName(const std::string& Name) {
|
||||||
std::string MSILWriter::getLabelName(const Value* V) {
|
std::string MSILWriter::getLabelName(const Value* V) {
|
||||||
std::string Name;
|
std::string Name;
|
||||||
if (const GlobalValue *GV = dyn_cast<GlobalValue>(V))
|
if (const GlobalValue *GV = dyn_cast<GlobalValue>(V))
|
||||||
Name = Mang->getMangledName(GV);
|
Name = GV->getName();
|
||||||
else {
|
else {
|
||||||
unsigned &No = AnonValueNumbers[V];
|
unsigned &No = AnonValueNumbers[V];
|
||||||
if (No == 0) No = ++NextAnonValueNumber;
|
if (No == 0) No = ++NextAnonValueNumber;
|
||||||
|
@ -1616,7 +1614,7 @@ const char* MSILWriter::getLibraryName(const Function* F) {
|
||||||
|
|
||||||
|
|
||||||
const char* MSILWriter::getLibraryName(const GlobalVariable* GV) {
|
const char* MSILWriter::getLibraryName(const GlobalVariable* GV) {
|
||||||
return getLibraryForSymbol(Mang->getMangledName(GV), false, CallingConv::C);
|
return getLibraryForSymbol(GV->getName(), false, CallingConv::C);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1674,7 +1672,7 @@ void MSILWriter::printExternals() {
|
||||||
std::string Tmp = getTypeName(I->getType())+getValueName(&*I);
|
std::string Tmp = getTypeName(I->getType())+getValueName(&*I);
|
||||||
printSimpleInstruction("ldsflda",Tmp.c_str());
|
printSimpleInstruction("ldsflda",Tmp.c_str());
|
||||||
Out << "\tldstr\t\"" << getLibraryName(&*I) << "\"\n";
|
Out << "\tldstr\t\"" << getLibraryName(&*I) << "\"\n";
|
||||||
Out << "\tldstr\t\"" << Mang->getMangledName(&*I) << "\"\n";
|
Out << "\tldstr\t\"" << I->getName() << "\"\n";
|
||||||
printSimpleInstruction("call","void* $MSIL_Import(string,string)");
|
printSimpleInstruction("call","void* $MSIL_Import(string,string)");
|
||||||
printIndirectSave(I->getType());
|
printIndirectSave(I->getType());
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
#include "llvm/Support/GetElementPtrTypeIterator.h"
|
#include "llvm/Support/GetElementPtrTypeIterator.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
#include "llvm/Support/Mangler.h"
|
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
extern Target TheMSILTarget;
|
extern Target TheMSILTarget;
|
||||||
|
@ -78,7 +77,6 @@ namespace llvm {
|
||||||
formatted_raw_ostream &Out;
|
formatted_raw_ostream &Out;
|
||||||
Module* ModulePtr;
|
Module* ModulePtr;
|
||||||
const TargetData* TD;
|
const TargetData* TD;
|
||||||
Mangler* Mang;
|
|
||||||
LoopInfo *LInfo;
|
LoopInfo *LInfo;
|
||||||
std::vector<StaticInitializer>* InitListPtr;
|
std::vector<StaticInitializer>* InitListPtr;
|
||||||
std::map<const GlobalVariable*,std::vector<StaticInitializer> >
|
std::map<const GlobalVariable*,std::vector<StaticInitializer> >
|
||||||
|
|
Loading…
Reference in New Issue