summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-13 07:40:56 +0000
committerChris Lattner <sabre@nondot.org>2010-03-13 07:40:56 +0000
commit8811e123142230ee9db7ff30f10df5a87668f5de (patch)
treefe65c7e2ce3b634552f8de9b2e938b5476628ae0
parente5b2c1d9be148bce081c811537189926220758d3 (diff)
downloadbcm5719-llvm-8811e123142230ee9db7ff30f10df5a87668f5de.tar.gz
bcm5719-llvm-8811e123142230ee9db7ff30f10df5a87668f5de.zip
factor some labels, simplify some code.
llvm-svn: 98429
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp9
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp8
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp12
3 files changed, 15 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 8ddea46cb8e..8510ae776fd 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2756,16 +2756,15 @@ emitFunctionDebugFrame(const FunctionDebugFrameInfo &DebugFrameInfo) {
getTempLabel("section_debug_frame"), true, false);
Asm->OutStreamer.AddComment("FDE initial location");
- Asm->OutStreamer.EmitSymbolValue(getDWLabel("func_begin",
- DebugFrameInfo.Number),
+ MCSymbol *FuncBeginSym = getDWLabel("func_begin", DebugFrameInfo.Number);
+ Asm->OutStreamer.EmitSymbolValue(FuncBeginSym,
TD->getPointerSize(), 0/*AddrSpace*/);
-
Asm->OutStreamer.AddComment("FDE address range");
- EmitDifference(getDWLabel("func_end", DebugFrameInfo.Number),
- getDWLabel("func_begin", DebugFrameInfo.Number));
+ EmitDifference(getDWLabel("func_end", DebugFrameInfo.Number), FuncBeginSym);
+ // FuncBeginSym.
EmitFrameMoves("func_begin", DebugFrameInfo.Number, DebugFrameInfo.Moves,
false);
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
index 09fae287f7d..58ebafa1050 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp
@@ -221,12 +221,13 @@ void DwarfException::EmitFDE(const FunctionEHFrameInfo &EHFrameInfo) {
EHFrameInfo.PersonalityIndex),
true, true);
+ MCSymbol *EHFuncBeginSym = getDWLabel("eh_func_begin", EHFrameInfo.Number);
Asm->OutStreamer.AddComment("FDE initial location");
- EmitReference(getDWLabel("eh_func_begin", EHFrameInfo.Number), FDEEncoding);
+ EmitReference(EHFuncBeginSym, FDEEncoding);
+
Asm->OutStreamer.AddComment("FDE address range");
- EmitDifference(getDWLabel("eh_func_end", EHFrameInfo.Number),
- getDWLabel("eh_func_begin", EHFrameInfo.Number),
+ EmitDifference(getDWLabel("eh_func_end", EHFrameInfo.Number),EHFuncBeginSym,
SizeOfEncodedValue(FDEEncoding) == 4);
// If there is a personality and landing pads then point to the language
@@ -246,6 +247,7 @@ void DwarfException::EmitFDE(const FunctionEHFrameInfo &EHFrameInfo) {
}
// Indicate locations of function specific callee saved registers in frame.
+ // EHFuncBeginSym
EmitFrameMoves("eh_func_begin", EHFrameInfo.Number, EHFrameInfo.Moves,
true);
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
index f55e4fe8e6c..3c00839aa77 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
@@ -240,12 +240,12 @@ void DwarfPrinter::EmitSectionOffset(const MCSymbol *Label,
void DwarfPrinter::EmitFrameMoves(const char *BaseLabel, unsigned BaseLabelID,
const std::vector<MachineMove> &Moves,
bool isEH) {
- int stackGrowth =
- Asm->TM.getFrameInfo()->getStackGrowthDirection() ==
- TargetFrameInfo::StackGrowsUp ?
- TD->getPointerSize() : -TD->getPointerSize();
- bool IsLocal = BaseLabel && strcmp(BaseLabel, "label") == 0;
-
+ int stackGrowth = TD->getPointerSize();
+ if (Asm->TM.getFrameInfo()->getStackGrowthDirection() !=
+ TargetFrameInfo::StackGrowsUp)
+ stackGrowth *= -1;
+
+ bool IsLocal = false;
for (unsigned i = 0, N = Moves.size(); i < N; ++i) {
const MachineMove &Move = Moves[i];
unsigned LabelID = Move.getLabelID();
OpenPOWER on IntegriCloud