Skip to content

Commit 00351b7

Browse files
author
Jim Grosbach
committed
Reverting 116059. Bots are unhappy with it.
llvm-svn: 116064
1 parent cf97db2 commit 00351b7

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

llvm/lib/Target/ARM/ARMCodeEmitter.cpp

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const //===-- ARM/ARMCodeEmitter.cpp - Convert ARM code to machine code ---------===//
1+
//===-- ARM/ARMCodeEmitter.cpp - Convert ARM code to machine code ---------===//
22
//
33
// The LLVM Compiler Infrastructure
44
//
@@ -150,9 +150,8 @@ namespace {
150150

151151
/// getMachineOpValue - Return binary encoding of operand. If the machine
152152
/// operand requires relocation, record the relocation and return zero.
153-
unsigned getMachineOpValue(const MachineInstr &MI,
154-
const MachineOperand &MO) const;
155-
unsigned getMachineOpValue(const MachineInstr &MI, unsigned OpIdx) const {
153+
unsigned getMachineOpValue(const MachineInstr &MI,const MachineOperand &MO);
154+
unsigned getMachineOpValue(const MachineInstr &MI, unsigned OpIdx) {
156155
return getMachineOpValue(MI, MI.getOperand(OpIdx));
157156
}
158157

@@ -170,12 +169,12 @@ namespace {
170169
/// fixed up by the relocation stage.
171170
void emitGlobalAddress(const GlobalValue *GV, unsigned Reloc,
172171
bool MayNeedFarStub, bool Indirect,
173-
intptr_t ACPV = 0) const;
174-
void emitExternalSymbolAddress(const char *ES, unsigned Reloc) const;
175-
void emitConstPoolAddress(unsigned CPI, unsigned Reloc) const;
176-
void emitJumpTableAddress(unsigned JTIndex, unsigned Reloc) const;
172+
intptr_t ACPV = 0);
173+
void emitExternalSymbolAddress(const char *ES, unsigned Reloc);
174+
void emitConstPoolAddress(unsigned CPI, unsigned Reloc);
175+
void emitJumpTableAddress(unsigned JTIndex, unsigned Reloc);
177176
void emitMachineBasicBlock(MachineBasicBlock *BB, unsigned Reloc,
178-
intptr_t JTBase = 0) const;
177+
intptr_t JTBase = 0);
179178
};
180179
}
181180

@@ -263,7 +262,7 @@ unsigned ARMCodeEmitter::getMovi32Value(const MachineInstr &MI,
263262
/// getMachineOpValue - Return binary encoding of operand. If the machine
264263
/// operand requires relocation, record the relocation and return zero.
265264
unsigned ARMCodeEmitter::getMachineOpValue(const MachineInstr &MI,
266-
const MachineOperand &MO) const {
265+
const MachineOperand &MO) {
267266
if (MO.isReg())
268267
return getARMRegisterNumbering(MO.getReg());
269268
else if (MO.isImm())
@@ -295,7 +294,7 @@ unsigned ARMCodeEmitter::getMachineOpValue(const MachineInstr &MI,
295294
///
296295
void ARMCodeEmitter::emitGlobalAddress(const GlobalValue *GV, unsigned Reloc,
297296
bool MayNeedFarStub, bool Indirect,
298-
intptr_t ACPV) const {
297+
intptr_t ACPV) {
299298
MachineRelocation MR = Indirect
300299
? MachineRelocation::getIndirectSymbol(MCE.getCurrentPCOffset(), Reloc,
301300
const_cast<GlobalValue *>(GV),
@@ -309,16 +308,15 @@ void ARMCodeEmitter::emitGlobalAddress(const GlobalValue *GV, unsigned Reloc,
309308
/// emitExternalSymbolAddress - Arrange for the address of an external symbol to
310309
/// be emitted to the current location in the function, and allow it to be PC
311310
/// relative.
312-
void ARMCodeEmitter::
313-
emitExternalSymbolAddress(const char *ES, unsigned Reloc) const {
311+
void ARMCodeEmitter::emitExternalSymbolAddress(const char *ES, unsigned Reloc) {
314312
MCE.addRelocation(MachineRelocation::getExtSym(MCE.getCurrentPCOffset(),
315313
Reloc, ES));
316314
}
317315

318316
/// emitConstPoolAddress - Arrange for the address of an constant pool
319317
/// to be emitted to the current location in the function, and allow it to be PC
320318
/// relative.
321-
void ARMCodeEmitter::emitConstPoolAddress(unsigned CPI, unsigned Reloc) const {
319+
void ARMCodeEmitter::emitConstPoolAddress(unsigned CPI, unsigned Reloc) {
322320
// Tell JIT emitter we'll resolve the address.
323321
MCE.addRelocation(MachineRelocation::getConstPool(MCE.getCurrentPCOffset(),
324322
Reloc, CPI, 0, true));
@@ -327,16 +325,14 @@ void ARMCodeEmitter::emitConstPoolAddress(unsigned CPI, unsigned Reloc) const {
327325
/// emitJumpTableAddress - Arrange for the address of a jump table to
328326
/// be emitted to the current location in the function, and allow it to be PC
329327
/// relative.
330-
void ARMCodeEmitter::
331-
emitJumpTableAddress(unsigned JTIndex, unsigned Reloc) const {
328+
void ARMCodeEmitter::emitJumpTableAddress(unsigned JTIndex, unsigned Reloc) {
332329
MCE.addRelocation(MachineRelocation::getJumpTable(MCE.getCurrentPCOffset(),
333330
Reloc, JTIndex, 0, true));
334331
}
335332

336333
/// emitMachineBasicBlock - Emit the specified address basic block.
337334
void ARMCodeEmitter::emitMachineBasicBlock(MachineBasicBlock *BB,
338-
unsigned Reloc,
339-
intptr_t JTBase) const {
335+
unsigned Reloc, intptr_t JTBase) {
340336
MCE.addRelocation(MachineRelocation::getBB(MCE.getCurrentPCOffset(),
341337
Reloc, BB, JTBase));
342338
}

llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class ARMMCCodeEmitter : public MCCodeEmitter {
4444

4545
/// getMachineOpValue - Return binary encoding of operand. If the machine
4646
/// operand requires relocation, record the relocation and return zero.
47-
unsigned getMachineOpValue(const MCInst &MI,const MCOperand &MO) const;
48-
unsigned getMachineOpValue(const MCInst &MI, unsigned OpIdx) const {
47+
unsigned getMachineOpValue(const MCInst &MI,const MCOperand &MO);
48+
unsigned getMachineOpValue(const MCInst &MI, unsigned OpIdx) {
4949
return getMachineOpValue(MI, MI.getOperand(OpIdx));
5050
}
5151

@@ -120,13 +120,17 @@ EncodeInstruction(const MCInst &MI, raw_ostream &OS,
120120
return;
121121

122122
++MCNumEmitted; // Keep track of the # of mi's emitted
123-
switch (Opcode) {
124-
//FIXME: Any non-pseudos that need special handling, if there are any...
125-
default: {
123+
switch (TSFlags & ARMII::FormMask) {
124+
case ARMII::BrMiscFrm:
125+
case ARMII::MiscFrm: {
126126
unsigned Value = getBinaryCodeForInstr(MI);
127127
EmitConstant(Value, 4, CurByte, OS);
128128
break;
129129
}
130+
default: {
131+
llvm_unreachable("Unhandled instruction encoding format!");
132+
break;
133+
}
130134
}
131135
}
132136

0 commit comments

Comments
 (0)