aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-04 05:21:31 +0000
committerChris Lattner <sabre@nondot.org>2010-04-04 05:21:31 +0000
commite812d4c604ce6b6b019f7e51a694ca7e158f5139 (patch)
tree2db07bab1979f79e445b148d275b0e4ecb62d178 /lib/Target
parent88db786712bd1e7b1dd829e02ef960f0828a8bec (diff)
downloadexternal_llvm-e812d4c604ce6b6b019f7e51a694ca7e158f5139.zip
external_llvm-e812d4c604ce6b6b019f7e51a694ca7e158f5139.tar.gz
external_llvm-e812d4c604ce6b6b019f7e51a694ca7e158f5139.tar.bz2
use predicates in DBG_VALUE printing code to simplify it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100312 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/X86/AsmPrinter/X86MCInstLower.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp b/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
index f384710..4732b2f 100644
--- a/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
+++ b/lib/Target/X86/AsmPrinter/X86MCInstLower.cpp
@@ -344,16 +344,17 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
O << " <- ";
if (NOps==3) {
// Register or immediate value. Register 0 means undef.
- assert(MI->getOperand(0).getType()==MachineOperand::MO_Register ||
- MI->getOperand(0).getType()==MachineOperand::MO_Immediate ||
- MI->getOperand(0).getType()==MachineOperand::MO_FPImmediate);
- if (MI->getOperand(0).getType()==MachineOperand::MO_Register &&
- MI->getOperand(0).getReg()==0) {
+ assert(MI->getOperand(0).isReg() ||
+ MI->getOperand(0).isImm() ||
+ MI->getOperand(0).isFPImm());
+ if (MI->getOperand(0).isReg() && MI->getOperand(0).getReg() == 0) {
// Suppress offset in this case, it is not meaningful.
O << "undef";
OutStreamer.AddBlankLine();
return;
- } else if (MI->getOperand(0).getType()==MachineOperand::MO_FPImmediate) {
+ }
+
+ if (MI->getOperand(0).isFPImm()) {
// This is more naturally done in printOperand, but since the only use
// of such an operand is in this comment and that is temporary (and it's
// ugly), we prefer to keep this localized.
@@ -373,16 +374,14 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
} else
printOperand(MI, 0, O);
} else {
- if (MI->getOperand(0).getType()==MachineOperand::MO_Register &&
- MI->getOperand(0).getReg()==0) {
+ if (MI->getOperand(0).isReg() && MI->getOperand(0).getReg() == 0) {
// Suppress offset in this case, it is not meaningful.
O << "undef";
OutStreamer.AddBlankLine();
return;
}
// Frame address. Currently handles register +- offset only.
- assert(MI->getOperand(0).getType()==MachineOperand::MO_Register);
- assert(MI->getOperand(3).getType()==MachineOperand::MO_Immediate);
+ assert(MI->getOperand(0).isReg() && MI->getOperand(3).isImm());
O << '['; printOperand(MI, 0, O); O << '+'; printOperand(MI, 3, O);
O << ']';
}