summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-04 21:34:40 +0000
committerChris Lattner <sabre@nondot.org>2010-04-04 21:34:40 +0000
commit83d1618b462ae42b61cfa366d090792eb10f05c6 (patch)
treeccece8ebfc9c3acf89e55d159b6b3176c53e864c
parentf88dce1f89ddb30b2370318284a6b307d7a44a98 (diff)
downloadllvm-83d1618b462ae42b61cfa366d090792eb10f05c6.tar.gz
llvm-83d1618b462ae42b61cfa366d090792eb10f05c6.tar.bz2
llvm-83d1618b462ae42b61cfa366d090792eb10f05c6.tar.xz
The "IsSmall" argument to EmitSectionOffset is always true,
constant fold it away. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100356 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp12
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfPrinter.cpp12
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfPrinter.h7
3 files changed, 13 insertions, 18 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 09a4a0985a..b09644c473 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2567,7 +2567,7 @@ void DwarfDebug::emitDebugInfo() {
Asm->EmitInt16(dwarf::DWARF_VERSION);
Asm->OutStreamer.AddComment("Offset Into Abbrev. Section");
EmitSectionOffset(Asm->GetTempSymbol("abbrev_begin"),
- Asm->GetTempSymbol("section_abbrev"), true);
+ Asm->GetTempSymbol("section_abbrev"));
Asm->OutStreamer.AddComment("Address Size (in bytes)");
Asm->EmitInt8(TD->getPointerSize());
@@ -2879,7 +2879,7 @@ emitFunctionDebugFrame(const FunctionDebugFrameInfo &DebugFrameInfo) {
Asm->OutStreamer.AddComment("FDE CIE offset");
EmitSectionOffset(Asm->GetTempSymbol("debug_frame_common"),
- Asm->GetTempSymbol("section_debug_frame"), true);
+ Asm->GetTempSymbol("section_debug_frame"));
Asm->OutStreamer.AddComment("FDE initial location");
MCSymbol *FuncBeginSym =
@@ -2918,7 +2918,7 @@ void DwarfDebug::emitDebugPubNames() {
Asm->OutStreamer.AddComment("Offset of Compilation Unit Info");
EmitSectionOffset(Asm->GetTempSymbol("info_begin", ModuleCU->getID()),
- Asm->GetTempSymbol("section_info"), true);
+ Asm->GetTempSymbol("section_info"));
Asm->OutStreamer.AddComment("Compilation Unit Length");
Asm->EmitLabelDifference(Asm->GetTempSymbol("info_end", ModuleCU->getID()),
@@ -2962,7 +2962,7 @@ void DwarfDebug::emitDebugPubTypes() {
Asm->OutStreamer.AddComment("Offset of Compilation ModuleCU Info");
EmitSectionOffset(Asm->GetTempSymbol("info_begin", ModuleCU->getID()),
- Asm->GetTempSymbol("section_info"), true);
+ Asm->GetTempSymbol("section_info"));
Asm->OutStreamer.AddComment("Compilation ModuleCU Length");
Asm->EmitLabelDifference(Asm->GetTempSymbol("info_end", ModuleCU->getID()),
@@ -3108,11 +3108,11 @@ void DwarfDebug::emitDebugInlineInfo() {
Asm->OutStreamer.EmitIntValue(0, 1, 0); // nul terminator.
} else
EmitSectionOffset(getStringPoolEntry(getRealLinkageName(LName)),
- Asm->GetTempSymbol("section_str"), true);
+ Asm->GetTempSymbol("section_str"));
Asm->OutStreamer.AddComment("Function name");
EmitSectionOffset(getStringPoolEntry(Name),
- Asm->GetTempSymbol("section_str"), true);
+ Asm->GetTempSymbol("section_str"));
Asm->EmitULEB128(Labels.size(), "Inline count");
for (SmallVector<InlineInfoLabels, 4>::iterator LI = Labels.begin(),
diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
index 495e1be58d..a224db8400 100644
--- a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
@@ -39,20 +39,16 @@ DwarfPrinter::DwarfPrinter(AsmPrinter *A)
void DwarfPrinter::EmitSectionOffset(const MCSymbol *Label,
- const MCSymbol *Section, bool IsSmall) {
- bool isAbsolute = MAI->isAbsoluteDebugSectionOffsets();
-
- if (!isAbsolute)
- return Asm->EmitLabelDifference(Label, Section,
- IsSmall ? 4 : TD->getPointerSize());
+ const MCSymbol *Section) {
+ if (!MAI->isAbsoluteDebugSectionOffsets())
+ return Asm->EmitLabelDifference(Label, Section, 4);
// On COFF targets, we have to emit the weird .secrel32 directive.
if (const char *SecOffDir = MAI->getDwarfSectionOffsetDirective()) {
// FIXME: MCize.
Asm->OutStreamer.EmitRawText(SecOffDir + Twine(Label->getName()));
} else {
- unsigned Size = IsSmall ? 4 : TD->getPointerSize();
- Asm->OutStreamer.EmitSymbolValue(Label, Size, 0/*AddrSpace*/);
+ Asm->OutStreamer.EmitSymbolValue(Label, 4, 0/*AddrSpace*/);
}
}
diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.h b/lib/CodeGen/AsmPrinter/DwarfPrinter.h
index 54c4f0c847..b6e4a2bbc2 100644
--- a/lib/CodeGen/AsmPrinter/DwarfPrinter.h
+++ b/lib/CodeGen/AsmPrinter/DwarfPrinter.h
@@ -74,10 +74,9 @@ public:
const MCAsmInfo *getMCAsmInfo() const { return MAI; }
const TargetData *getTargetData() const { return TD; }
- /// EmitSectionOffset - Emit Label-Section or use a special purpose directive
- /// to emit a section offset if the target has one.
- void EmitSectionOffset(const MCSymbol *Label, const MCSymbol *Section,
- bool IsSmall = false);
+ /// EmitSectionOffset - Emit a 4-byte "Label-Section" value or use a special
+ /// purpose directive to emit a section offset if the target has one.
+ void EmitSectionOffset(const MCSymbol *Label, const MCSymbol *Section);
/// EmitFrameMoves - Emit frame instructions to describe the layout of the
/// frame.