[llvm-commits] [llvm] r100369 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
Chris Lattner
sabre at nondot.org
Sun Apr 4 16:31:58 PDT 2010
Author: lattner
Date: Sun Apr 4 18:31:58 2010
New Revision: 100369
URL: http://llvm.org/viewvc/llvm-project?rev=100369&view=rev
Log:
simplify code and reduce indentation.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp?rev=100369&r1=100368&r2=100369&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp Sun Apr 4 18:31:58 2010
@@ -70,43 +70,40 @@
// If advancing cfa.
if (Dst.isReg() && Dst.getReg() == MachineLocation::VirtualFP) {
- if (!Src.isReg()) {
- if (Src.getReg() == MachineLocation::VirtualFP) {
- Asm->EmitCFAByte(dwarf::DW_CFA_def_cfa_offset);
- } else {
- Asm->EmitCFAByte(dwarf::DW_CFA_def_cfa);
- Asm->EmitULEB128(RI->getDwarfRegNum(Src.getReg(), isEH), "Register");
- }
+ assert(!Src.isReg() && "Machine move not supported yet.");
- int Offset = -Src.getOffset();
- Asm->EmitULEB128(Offset, "Offset");
+ if (Src.getReg() == MachineLocation::VirtualFP) {
+ Asm->EmitCFAByte(dwarf::DW_CFA_def_cfa_offset);
} else {
- llvm_unreachable("Machine move not supported yet.");
+ Asm->EmitCFAByte(dwarf::DW_CFA_def_cfa);
+ Asm->EmitULEB128(RI->getDwarfRegNum(Src.getReg(), isEH), "Register");
}
- } else if (Src.isReg() &&
- Src.getReg() == MachineLocation::VirtualFP) {
- if (Dst.isReg()) {
- Asm->EmitCFAByte(dwarf::DW_CFA_def_cfa_register);
- Asm->EmitULEB128(RI->getDwarfRegNum(Dst.getReg(), isEH), "Register");
- } else {
- llvm_unreachable("Machine move not supported yet.");
- }
- } else {
- unsigned Reg = RI->getDwarfRegNum(Src.getReg(), isEH);
- int Offset = Dst.getOffset() / stackGrowth;
- if (Offset < 0) {
- Asm->EmitCFAByte(dwarf::DW_CFA_offset_extended_sf);
- Asm->EmitULEB128(Reg, "Reg");
- Asm->EmitSLEB128(Offset, "Offset");
- } else if (Reg < 64) {
- Asm->EmitCFAByte(dwarf::DW_CFA_offset + Reg);
- Asm->EmitULEB128(Offset, "Offset");
- } else {
- Asm->EmitCFAByte(dwarf::DW_CFA_offset_extended);
- Asm->EmitULEB128(Reg, "Reg");
- Asm->EmitULEB128(Offset, "Offset");
- }
+ Asm->EmitULEB128(-Src.getOffset(), "Offset");
+ continue;
+ }
+
+ if (Src.isReg() && Src.getReg() == MachineLocation::VirtualFP) {
+ assert(Dst.isReg() && "Machine move not supported yet.");
+ Asm->EmitCFAByte(dwarf::DW_CFA_def_cfa_register);
+ Asm->EmitULEB128(RI->getDwarfRegNum(Dst.getReg(), isEH), "Register");
+ continue;
+ }
+
+ unsigned Reg = RI->getDwarfRegNum(Src.getReg(), isEH);
+ int Offset = Dst.getOffset() / stackGrowth;
+
+ if (Offset < 0) {
+ Asm->EmitCFAByte(dwarf::DW_CFA_offset_extended_sf);
+ Asm->EmitULEB128(Reg, "Reg");
+ Asm->EmitSLEB128(Offset, "Offset");
+ } else if (Reg < 64) {
+ Asm->EmitCFAByte(dwarf::DW_CFA_offset + Reg);
+ Asm->EmitULEB128(Offset, "Offset");
+ } else {
+ Asm->EmitCFAByte(dwarf::DW_CFA_offset_extended);
+ Asm->EmitULEB128(Reg, "Reg");
+ Asm->EmitULEB128(Offset, "Offset");
}
}
}
More information about the llvm-commits
mailing list