Temporary revert my last commit: it seems it's triggering some subtle bug in backend

and breaks llvm-gcc

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58926 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov 2008-11-08 23:05:05 +00:00
parent b5b9252a17
commit 0b45c9957f
6 changed files with 31 additions and 19 deletions

View File

@ -362,9 +362,6 @@ namespace llvm {
/// this is suported by the target.
void printVisibility(const std::string& Name, unsigned Visibility) const;
/// printOffset - This is just convenient handler for printing offsets.
void printOffset(int64_t Offset) const;
private:
const GlobalValue *findGlobalValue(const Constant* CV);
void EmitLLVMUsedList(Constant *List);

View File

@ -1520,13 +1520,6 @@ void AsmPrinter::printVisibility(const std::string& Name,
}
}
void AsmPrinter::printOffset(int64_t Offset) const {
if (Offset > 0)
O << '+' << Offset;
else if (Offset < 0)
O << Offset;
}
GCMetadataPrinter *AsmPrinter::GetOrCreateGCPrinter(GCStrategy *S) {
if (!S->usesMetadata())
return 0;

View File

@ -300,9 +300,12 @@ void ARMAsmPrinter::printOperand(const MachineInstr *MI, int opNum,
FnStubs.insert(Name);
} else
O << Name;
printOffset(MO.getOffset());
if (MO.getOffset() > 0)
O << '+' << MO.getOffset();
else if (MO.getOffset() < 0)
O << MO.getOffset();
if (isCallOp && Subtarget->isTargetELF() &&
TM.getRelocationModel() == Reloc::PIC_)
O << "(PLT)";
@ -342,7 +345,7 @@ static void printSOImm(raw_ostream &O, int64_t V, const TargetAsmInfo *TAI) {
assert(V < (1 << 12) && "Not a valid so_imm value!");
unsigned Imm = ARM_AM::getSOImmValImm(V);
unsigned Rot = ARM_AM::getSOImmValRot(V);
// Print low-level immediate formation info, per
// A5.1.3: "Data-processing operands - Immediate".
if (Rot) {

View File

@ -398,7 +398,10 @@ void PPCAsmPrinter::printOp(const MachineOperand &MO) {
}
O << Name;
printOffset(MO.getOffset());
if (MO.getOffset() > 0)
O << "+" << MO.getOffset();
else if (MO.getOffset() < 0)
O << MO.getOffset();
if (GV->hasExternalWeakLinkage())
ExtWeakSymbols.insert(GV);

View File

@ -344,7 +344,11 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
O << "@GOTOFF";
}
printOffset(MO.getOffset());
int Offset = MO.getOffset();
if (Offset > 0)
O << '+' << Offset;
else if (Offset < 0)
O << Offset;
if (isMemOp && Subtarget->isPICStyleRIPRel() && !NotRIPRel)
O << "(%rip)";
@ -425,7 +429,11 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
if (GV->hasExternalWeakLinkage())
ExtWeakSymbols.insert(GV);
printOffset(MO.getOffset());
int Offset = MO.getOffset();
if (Offset > 0)
O << '+' << Offset;
else if (Offset < 0)
O << Offset;
if (isThreadLocal) {
if (TM.getRelocationModel() == Reloc::PIC_ || Subtarget->is64Bit())

View File

@ -235,7 +235,11 @@ void X86IntelAsmPrinter::printOp(const MachineOperand &MO,
if (!isMemOp) O << "OFFSET ";
O << "[" << TAI->getPrivateGlobalPrefix() << "CPI"
<< getFunctionNumber() << "_" << MO.getIndex();
printOffset(MO.getOffset());
int Offset = MO.getOffset();
if (Offset > 0)
O << " + " << Offset;
else if (Offset < 0)
O << Offset;
O << "]";
return;
}
@ -254,7 +258,11 @@ void X86IntelAsmPrinter::printOp(const MachineOperand &MO,
O << "__imp_";
}
O << Name;
printOffset(MO.getOffset());
int Offset = MO.getOffset();
if (Offset > 0)
O << " + " << Offset;
else if (Offset < 0)
O << Offset;
return;
}
case MachineOperand::MO_ExternalSymbol: {