aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/CBackend/CBackend.cpp7
-rw-r--r--lib/Target/CppBackend/CPPBackend.cpp14
-rw-r--r--lib/Target/MSIL/MSILWriter.cpp5
3 files changed, 2 insertions, 24 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index fe63edf3ff..cbf769bf01 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -302,7 +302,6 @@ namespace {
void visitInlineAsm(CallInst &I);
bool visitBuiltinCall(CallInst &I, Intrinsic::ID ID, bool &WroteCallee);
- void visitMallocInst(MallocInst &I);
void visitAllocaInst(AllocaInst &I);
void visitFreeInst (FreeInst &I);
void visitLoadInst (LoadInst &I);
@@ -3405,10 +3404,6 @@ void CWriter::visitInlineAsm(CallInst &CI) {
Out << ")";
}
-void CWriter::visitMallocInst(MallocInst &I) {
- llvm_unreachable("lowerallocations pass didn't work!");
-}
-
void CWriter::visitAllocaInst(AllocaInst &I) {
Out << '(';
printType(Out, I.getType());
@@ -3690,7 +3685,7 @@ bool CTargetMachine::addPassesToEmitWholeFile(PassManager &PM,
if (FileType != TargetMachine::AssemblyFile) return true;
PM.add(createGCLoweringPass());
- PM.add(createLowerAllocationsPass(true));
+ PM.add(createLowerAllocationsPass());
PM.add(createLowerInvokePass());
PM.add(createCFGSimplificationPass()); // clean up after lower invoke.
PM.add(new CBackendNameAllUsedStructsAndMergeFunctions());
diff --git a/lib/Target/CppBackend/CPPBackend.cpp b/lib/Target/CppBackend/CPPBackend.cpp
index 14ad451074..45c2a7b1e3 100644
--- a/lib/Target/CppBackend/CPPBackend.cpp
+++ b/lib/Target/CppBackend/CPPBackend.cpp
@@ -1258,20 +1258,6 @@ namespace {
Out << "\");";
break;
}
- case Instruction::Malloc: {
- const MallocInst* mallocI = cast<MallocInst>(I);
- Out << "MallocInst* " << iName << " = new MallocInst("
- << getCppName(mallocI->getAllocatedType()) << ", ";
- if (mallocI->isArrayAllocation())
- Out << opNames[0] << ", " ;
- Out << "\"";
- printEscapedString(mallocI->getName());
- Out << "\", " << bbname << ");";
- if (mallocI->getAlignment())
- nl(Out) << iName << "->setAlignment("
- << mallocI->getAlignment() << ");";
- break;
- }
case Instruction::Free: {
Out << "FreeInst* " << iName << " = new FreeInst("
<< getCppName(I->getOperand(0)) << ", " << bbname << ");";
diff --git a/lib/Target/MSIL/MSILWriter.cpp b/lib/Target/MSIL/MSILWriter.cpp
index 26d637b434..cf08a97a95 100644
--- a/lib/Target/MSIL/MSILWriter.cpp
+++ b/lib/Target/MSIL/MSILWriter.cpp
@@ -1191,9 +1191,6 @@ void MSILWriter::printInstruction(const Instruction* Inst) {
case Instruction::Alloca:
printAllocaInstruction(cast<AllocaInst>(Inst));
break;
- case Instruction::Malloc:
- llvm_unreachable("LowerAllocationsPass used");
- break;
case Instruction::Free:
llvm_unreachable("LowerAllocationsPass used");
break;
@@ -1702,7 +1699,7 @@ bool MSILTarget::addPassesToEmitWholeFile(PassManager &PM,
if (FileType != TargetMachine::AssemblyFile) return true;
MSILWriter* Writer = new MSILWriter(o);
PM.add(createGCLoweringPass());
- PM.add(createLowerAllocationsPass(true));
+ PM.add(createLowerAllocationsPass());
// FIXME: Handle switch trougth native IL instruction "switch"
PM.add(createLowerSwitchPass());
PM.add(createCFGSimplificationPass());