[llvm-commits] [llvm] r80198 - in /llvm/trunk/lib/CodeGen/AsmPrinter: AsmPrinter.cpp DwarfException.cpp
Bill Wendling
isanbard at gmail.com
Wed Aug 26 20:32:50 PDT 2009
Author: void
Date: Wed Aug 26 22:32:50 2009
New Revision: 80198
URL: http://llvm.org/viewvc/llvm-project?rev=80198&view=rev
Log:
Revert accidental commit.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=80198&r1=80197&r2=80198&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Wed Aug 26 22:32:50 2009
@@ -604,186 +604,6 @@
O << '\n';
}
-static const char *GetDataFormatName(unsigned DataFormat) {
-#ifndef HAVE_DESIGNATED_INITIALIZERS
-#define HAVE_DESIGNATED_INITIALIZERS \
- ((!defined(__cplusplus) && (GCC_VERSION >= 2007)) \
- || (__STDC_VERSION__ >= 199901L))
-#endif
-
-#if HAVE_DESIGNATED_INITIALIZERS
-#define S(p, v) [p] = v,
-#else
-#define S(p, v) case p: return v;
-#endif
-
-#if HAVE_DESIGNATED_INITIALIZERS
- __extension__ static const char * const FormatNames[256] = {
-#else
- switch (DataFormat) {
-#endif
-
- S(dwarf::DW_EH_PE_absptr, "absolute")
- S(dwarf::DW_EH_PE_omit, "omit")
- S(dwarf::DW_EH_PE_aligned, "aligned absolute")
-
- S(dwarf::DW_EH_PE_uleb128, "uleb128")
- S(dwarf::DW_EH_PE_udata2, "udata2")
- S(dwarf::DW_EH_PE_udata4, "udata4")
- S(dwarf::DW_EH_PE_udata8, "udata8")
- S(dwarf::DW_EH_PE_sleb128, "sleb128")
- S(dwarf::DW_EH_PE_sdata2, "sdata2")
- S(dwarf::DW_EH_PE_sdata4, "sdata4")
- S(dwarf::DW_EH_PE_sdata8, "sdata8")
-
- S(dwarf::DW_EH_PE_absptr | dwarf::DW_EH_PE_pcrel, "pcrel")
- S(dwarf::DW_EH_PE_uleb128 | dwarf::DW_EH_PE_pcrel, "pcrel uleb128")
- S(dwarf::DW_EH_PE_udata2 | dwarf::DW_EH_PE_pcrel, "pcrel udata2")
- S(dwarf::DW_EH_PE_udata4 | dwarf::DW_EH_PE_pcrel, "pcrel udata4")
- S(dwarf::DW_EH_PE_udata8 | dwarf::DW_EH_PE_pcrel, "pcrel udata8")
- S(dwarf::DW_EH_PE_sleb128 | dwarf::DW_EH_PE_pcrel, "pcrel sleb128")
- S(dwarf::DW_EH_PE_sdata2 | dwarf::DW_EH_PE_pcrel, "pcrel sdata2")
- S(dwarf::DW_EH_PE_sdata4 | dwarf::DW_EH_PE_pcrel, "pcrel sdata4")
- S(dwarf::DW_EH_PE_sdata8 | dwarf::DW_EH_PE_pcrel, "pcrel sdata8")
-
- S(dwarf::DW_EH_PE_absptr | dwarf::DW_EH_PE_textrel, "textrel")
- S(dwarf::DW_EH_PE_uleb128 | dwarf::DW_EH_PE_textrel, "textrel uleb128")
- S(dwarf::DW_EH_PE_udata2 | dwarf::DW_EH_PE_textrel, "textrel udata2")
- S(dwarf::DW_EH_PE_udata4 | dwarf::DW_EH_PE_textrel, "textrel udata4")
- S(dwarf::DW_EH_PE_udata8 | dwarf::DW_EH_PE_textrel, "textrel udata8")
- S(dwarf::DW_EH_PE_sleb128 | dwarf::DW_EH_PE_textrel, "textrel sleb128")
- S(dwarf::DW_EH_PE_sdata2 | dwarf::DW_EH_PE_textrel, "textrel sdata2")
- S(dwarf::DW_EH_PE_sdata4 | dwarf::DW_EH_PE_textrel, "textrel sdata4")
- S(dwarf::DW_EH_PE_sdata8 | dwarf::DW_EH_PE_textrel, "textrel sdata8")
-
- S(dwarf::DW_EH_PE_absptr | dwarf::DW_EH_PE_datarel, "datarel")
- S(dwarf::DW_EH_PE_uleb128 | dwarf::DW_EH_PE_datarel, "datarel uleb128")
- S(dwarf::DW_EH_PE_udata2 | dwarf::DW_EH_PE_datarel, "datarel udata2")
- S(dwarf::DW_EH_PE_udata4 | dwarf::DW_EH_PE_datarel, "datarel udata4")
- S(dwarf::DW_EH_PE_udata8 | dwarf::DW_EH_PE_datarel, "datarel udata8")
- S(dwarf::DW_EH_PE_sleb128 | dwarf::DW_EH_PE_datarel, "datarel sleb128")
- S(dwarf::DW_EH_PE_sdata2 | dwarf::DW_EH_PE_datarel, "datarel sdata2")
- S(dwarf::DW_EH_PE_sdata4 | dwarf::DW_EH_PE_datarel, "datarel sdata4")
- S(dwarf::DW_EH_PE_sdata8 | dwarf::DW_EH_PE_datarel, "datarel sdata8")
-
- S(dwarf::DW_EH_PE_absptr | dwarf::DW_EH_PE_funcrel, "funcrel")
- S(dwarf::DW_EH_PE_uleb128 | dwarf::DW_EH_PE_funcrel, "funcrel uleb128")
- S(dwarf::DW_EH_PE_udata2 | dwarf::DW_EH_PE_funcrel, "funcrel udata2")
- S(dwarf::DW_EH_PE_udata4 | dwarf::DW_EH_PE_funcrel, "funcrel udata4")
- S(dwarf::DW_EH_PE_udata8 | dwarf::DW_EH_PE_funcrel, "funcrel udata8")
- S(dwarf::DW_EH_PE_sleb128 | dwarf::DW_EH_PE_funcrel, "funcrel sleb128")
- S(dwarf::DW_EH_PE_sdata2 | dwarf::DW_EH_PE_funcrel, "funcrel sdata2")
- S(dwarf::DW_EH_PE_sdata4 | dwarf::DW_EH_PE_funcrel, "funcrel sdata4")
- S(dwarf::DW_EH_PE_sdata8 | dwarf::DW_EH_PE_funcrel, "funcrel sdata8")
-
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_absptr |dwarf::DW_EH_PE_pcrel,
- "indirect pcrel")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_uleb128 |dwarf::DW_EH_PE_pcrel,
- "indirect pcrel uleb128")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata2 |dwarf::DW_EH_PE_pcrel,
- "indirect pcrel udata2")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata4 |dwarf::DW_EH_PE_pcrel,
- "indirect pcrel udata4")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata8 |dwarf::DW_EH_PE_pcrel,
- "indirect pcrel udata8")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sleb128 |dwarf::DW_EH_PE_pcrel,
- "indirect pcrel sleb128")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata2 |dwarf::DW_EH_PE_pcrel,
- "indirect pcrel sdata2")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata4 |dwarf::DW_EH_PE_pcrel,
- "indirect pcrel sdata4")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata8 |dwarf::DW_EH_PE_pcrel,
- "indirect pcrel sdata8")
-
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_absptr |dwarf::DW_EH_PE_textrel,
- "indirect textrel")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_uleb128 |dwarf::DW_EH_PE_textrel,
- "indirect textrel uleb128")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata2 |dwarf::DW_EH_PE_textrel,
- "indirect textrel udata2")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata4 |dwarf::DW_EH_PE_textrel,
- "indirect textrel udata4")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata8 |dwarf::DW_EH_PE_textrel,
- "indirect textrel udata8")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sleb128 |dwarf::DW_EH_PE_textrel,
- "indirect textrel sleb128")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata2 |dwarf::DW_EH_PE_textrel,
- "indirect textrel sdata2")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata4 |dwarf::DW_EH_PE_textrel,
- "indirect textrel sdata4")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata8 |dwarf::DW_EH_PE_textrel,
- "indirect textrel sdata8")
-
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_absptr |dwarf::DW_EH_PE_datarel,
- "indirect datarel")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_uleb128 |dwarf::DW_EH_PE_datarel,
- "indirect datarel uleb128")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata2 |dwarf::DW_EH_PE_datarel,
- "indirect datarel udata2")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata4 |dwarf::DW_EH_PE_datarel,
- "indirect datarel udata4")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata8 |dwarf::DW_EH_PE_datarel,
- "indirect datarel udata8")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sleb128 |dwarf::DW_EH_PE_datarel,
- "indirect datarel sleb128")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata2 |dwarf::DW_EH_PE_datarel,
- "indirect datarel sdata2")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata4 |dwarf::DW_EH_PE_datarel,
- "indirect datarel sdata4")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata8 |dwarf::DW_EH_PE_datarel,
- "indirect datarel sdata8")
-
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_absptr |dwarf::DW_EH_PE_funcrel,
- "indirect funcrel")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_uleb128 |dwarf::DW_EH_PE_funcrel,
- "indirect funcrel uleb128")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata2 |dwarf::DW_EH_PE_funcrel,
- "indirect funcrel udata2")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata4 |dwarf::DW_EH_PE_funcrel,
- "indirect funcrel udata4")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_udata8 |dwarf::DW_EH_PE_funcrel,
- "indirect funcrel udata8")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sleb128 |dwarf::DW_EH_PE_funcrel,
- "indirect funcrel sleb128")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata2 |dwarf::DW_EH_PE_funcrel,
- "indirect funcrel sdata2")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata4 |dwarf::DW_EH_PE_funcrel,
- "indirect funcrel sdata4")
- S(dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_sdata8 |dwarf::DW_EH_PE_funcrel,
- "indirect funcrel sdata8")
-
-#if HAVE_DESIGNATED_INITIALIZERS
- };
-
- assert(DataFormat >= 0 && DataFormat < 0x100 && FormatNames[DataFormat] &&
- "Invalid DWARF data format!");
- return FormatNames[DataFormat];
-#else
- }
- llvm_unreachable("Invalid DWARF data format!");
- return 0;
-#endif
-#undef HAVE_DESIGNATED_INITIALIZERS
-}
-
-void AsmPrinter::EOL(const std::string &Comment, unsigned DataFormat) const {
- if (VerboseAsm && !Comment.empty()) {
- O.PadToColumn(MAI->getCommentColumn());
- O << MAI->getCommentString()
- << ' ' << Comment << " (" << GetDataFormatName(DataFormat) << ')';
- }
- O << '\n';
-}
-
-void AsmPrinter::EOL(const char* Comment, unsigned DataFormat) const {
- if (VerboseAsm && *Comment) {
- O.PadToColumn(MAI->getCommentColumn());
- O << MAI->getCommentString()
- << ' ' << Comment << " (" << GetDataFormatName(DataFormat) << ')';
- }
- O << '\n';
-}
-
/// EmitULEB128Bytes - Emit an assembler byte data directive to compose an
/// unsigned leb128 value.
void AsmPrinter::EmitULEB128Bytes(unsigned Value) const {
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=80198&r1=80197&r2=80198&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Wed Aug 26 22:32:50 2009
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This file contains support for writing DWARF exception info into asm files.
+// This file contains support for writing dwarf exception info into asm files.
//
//===----------------------------------------------------------------------===//
@@ -98,19 +98,16 @@
// If there is a personality, we need to indicate the function's location.
if (Personality) {
- unsigned Encoding = 0;
Asm->EmitULEB128Bytes(7);
Asm->EOL("Augmentation Size");
if (MAI->getNeedsIndirectEncoding()) {
- Encoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4 |
- dwarf::DW_EH_PE_indirect;
- Asm->EmitInt8(Encoding);
- Asm->EOL("Personality", Encoding);
+ Asm->EmitInt8(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4 |
+ dwarf::DW_EH_PE_indirect);
+ Asm->EOL("Personality (pcrel sdata4 indirect)");
} else {
- Encoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
- Asm->EmitInt8(Encoding);
- Asm->EOL("Personality", Encoding);
+ Asm->EmitInt8(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
+ Asm->EOL("Personality (pcrel sdata4)");
}
PrintRelDirective(true);
@@ -121,20 +118,17 @@
O << "-" << MAI->getPCSymbol();
Asm->EOL("Personality");
- Encoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
- Asm->EmitInt8(Encoding);
- Asm->EOL("LSDA Encoding", Encoding);
-
- Encoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
- Asm->EmitInt8(Encoding);
- Asm->EOL("FDE Encoding", Encoding);
+ Asm->EmitInt8(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
+ Asm->EOL("LSDA Encoding (pcrel sdata4)");
+
+ Asm->EmitInt8(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
+ Asm->EOL("FDE Encoding (pcrel sdata4)");
} else {
Asm->EmitULEB128Bytes(1);
Asm->EOL("Augmentation Size");
- unsigned Encoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
- Asm->EmitInt8(Encoding);
- Asm->EOL("FDE Encoding", Encoding);
+ Asm->EmitInt8(dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4);
+ Asm->EOL("FDE Encoding (pcrel sdata4)");
}
// Indicate locations of general callee saved registers in frame.
@@ -604,17 +598,15 @@
}
// Emit the header.
- unsigned Encoding = dwarf::DW_EH_PE_omit;
- Asm->EmitInt8(Encoding);
- Asm->EOL("@LPStart format", Encoding);
+ Asm->EmitInt8(dwarf::DW_EH_PE_omit);
+ Asm->EOL("@LPStart format (DW_EH_PE_omit)");
#if 0
if (TypeInfos.empty() && FilterIds.empty()) {
// If there are no typeinfos or filters, there is nothing to emit, optimize
// by specifying the "omit" encoding.
- Encoding = dwarf::DW_EH_PE_omit;
- Asm->EmitInt8(Encoding);
- Asm->EOL("@TType format", Encoding);
+ Asm->EmitInt8(dwarf::DW_EH_PE_omit);
+ Asm->EOL("@TType format (DW_EH_PE_omit)");
} else {
// Okay, we have actual filters or typeinfos to emit. As such, we need to
// pick a type encoding for them. We're about to emit a list of pointers to
@@ -642,13 +634,12 @@
//
if (LSDASection->isWritable() ||
Asm->TM.getRelocationModel() == Reloc::Static) {
- Encoding = DW_EH_PE_absptr;
- Asm->EmitInt8(Encoding);
- Asm->EOL("TType format", Encoding);
+ Asm->EmitInt8(DW_EH_PE_absptr);
+ Asm->EOL("TType format (DW_EH_PE_absptr)");
} else {
- Encoding = DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4;
Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4);
- Asm->EOL("TType format", Encoding);
+ Asm->EOL("TType format (DW_EH_PE_pcrel | DW_EH_PE_indirect"
+ " | DW_EH_PE_sdata4)");
}
Asm->EmitULEB128Bytes(TypeOffset);
Asm->EOL("TType base offset");
@@ -658,13 +649,11 @@
// say that we're omitting that bit.
// FIXME: does this apply to Dwarf also? The above #if 0 implies yes?
if (!HaveTTData) {
- Encoding = dwarf::DW_EH_PE_omit;
- Asm->EmitInt8(Encoding);
- Asm->EOL("@TType format", Encoding);
+ Asm->EmitInt8(dwarf::DW_EH_PE_omit);
+ Asm->EOL("@TType format (DW_EH_PE_omit)");
} else {
- Encoding = dwarf::DW_EH_PE_absptr;
- Asm->EmitInt8(Encoding);
- Asm->EOL("@TType format", Encoding);
+ Asm->EmitInt8(dwarf::DW_EH_PE_absptr);
+ Asm->EOL("@TType format (DW_EH_PE_absptr)");
Asm->EmitULEB128Bytes(TypeOffset);
Asm->EOL("@TType base offset");
}
@@ -672,9 +661,8 @@
// SjLj Exception handilng
if (MAI->getExceptionHandlingType() == ExceptionHandling::SjLj) {
- Encoding = dwarf::DW_EH_PE_udata4;
- Asm->EmitInt8(Encoding);
- Asm->EOL("Call site format", Encoding);
+ Asm->EmitInt8(dwarf::DW_EH_PE_udata4);
+ Asm->EOL("Call site format (DW_EH_PE_udata4)");
Asm->EmitULEB128Bytes(SizeSites);
Asm->EOL("Call site table length");
@@ -726,9 +714,8 @@
// will call `terminate()'.
// Emit the landing pad call site table.
- Encoding = dwarf::DW_EH_PE_udata4;
- Asm->EmitInt8(Encoding);
- Asm->EOL("Call site format", Encoding);
+ Asm->EmitInt8(dwarf::DW_EH_PE_udata4);
+ Asm->EOL("Call site format (DW_EH_PE_udata4)");
Asm->EmitULEB128Bytes(SizeSites);
Asm->EOL("Call site table size");
More information about the llvm-commits
mailing list