[llvm-commits] CVS: llvm/lib/CodeGen/AsmPrinter.cpp
Anton Korobeynikov
asl at math.spbu.ru
Tue Dec 19 13:04:36 PST 2006
Changes in directory llvm/lib/CodeGen:
AsmPrinter.cpp updated: 1.126 -> 1.127
---
Log message:
Fix for PR1059: http://llvm.org/PR1059 : http://llvm.org/PR1059: http://llvm.org/PR1059
---
Diffs of the changes: (+6 -3)
AsmPrinter.cpp | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
Index: llvm/lib/CodeGen/AsmPrinter.cpp
diff -u llvm/lib/CodeGen/AsmPrinter.cpp:1.126 llvm/lib/CodeGen/AsmPrinter.cpp:1.127
--- llvm/lib/CodeGen/AsmPrinter.cpp:1.126 Sun Dec 17 21:37:18 2006
+++ llvm/lib/CodeGen/AsmPrinter.cpp Tue Dec 19 15:04:20 2006
@@ -214,14 +214,17 @@
// Pick the directive to use to print the jump table entries, and switch to
// the appropriate section.
TargetLowering *LoweringInfo = TM.getTargetLowering();
-
- if (IsPic && !(LoweringInfo && LoweringInfo->usesGlobalOffsetTable())) {
+
+ const char* JumpTableDataSection = TAI->getJumpTableDataSection();
+ if ((IsPic && !(LoweringInfo && LoweringInfo->usesGlobalOffsetTable())) ||
+ !JumpTableDataSection) {
// In PIC mode, we need to emit the jump table to the same section as the
// function body itself, otherwise the label differences won't make sense.
+ // We should also do if the section name is NULL.
const Function *F = MF.getFunction();
SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
} else {
- SwitchToDataSection(TAI->getJumpTableDataSection());
+ SwitchToDataSection(JumpTableDataSection);
}
EmitAlignment(Log2_32(MJTI->getAlignment()));
More information about the llvm-commits
mailing list