[llvm] r217021 - Follow-up for r217020: actually commit the fix for PR20800,
Alexander Potapenko
glider at google.com
Wed Sep 3 00:37:20 PDT 2014
Author: glider
Date: Wed Sep 3 02:37:20 2014
New Revision: 217021
URL: http://llvm.org/viewvc/llvm-project?rev=217021&view=rev
Log:
Follow-up for r217020: actually commit the fix for PR20800,
revert the accidentally committed changes to LLVMSymbolize.cpp
Modified:
llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp
Modified: llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp?rev=217021&r1=217020&r2=217021&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp Wed Sep 3 02:37:20 2014
@@ -437,10 +437,30 @@ class DarwinX86AsmBackend : public X86As
bool Is64Bit;
unsigned OffsetSize; ///< Offset of a "push" instruction.
- unsigned PushInstrSize; ///< Size of a "push" instruction.
unsigned MoveInstrSize; ///< Size of a "move" instruction.
unsigned StackDivide; ///< Amount to adjust stack size by.
protected:
+ /// \brief Size of a "push" instruction for the given register.
+ unsigned PushInstrSize(unsigned Reg) const {
+ switch (Reg) {
+ case X86::EBX:
+ case X86::ECX:
+ case X86::EDX:
+ case X86::EDI:
+ case X86::ESI:
+ case X86::EBP:
+ case X86::RBX:
+ case X86::RBP:
+ return 1;
+ case X86::R12:
+ case X86::R13:
+ case X86::R14:
+ case X86::R15:
+ return 2;
+ }
+ return 1;
+ }
+
/// \brief Implementation of algorithm to generate the compact unwind encoding
/// for the CFI instructions.
uint32_t
@@ -530,7 +550,7 @@ protected:
unsigned Reg = MRI.getLLVMRegNum(Inst.getRegister(), true);
SavedRegs[SavedRegIdx++] = Reg;
StackAdjust += OffsetSize;
- InstrOffset += PushInstrSize;
+ InstrOffset += PushInstrSize(Reg);
break;
}
}
@@ -724,7 +744,6 @@ public:
OffsetSize = Is64Bit ? 8 : 4;
MoveInstrSize = Is64Bit ? 3 : 2;
StackDivide = Is64Bit ? 8 : 4;
- PushInstrSize = 1;
}
};
Modified: llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp?rev=217021&r1=217020&r2=217021&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp (original)
+++ llvm/trunk/tools/llvm-symbolizer/LLVMSymbolize.cpp Wed Sep 3 02:37:20 2014
@@ -306,26 +306,19 @@ LLVMSymbolizer::getOrCreateBinary(const
// Check if it's a universal binary.
Bin = ParsedBinary.getBinary().get();
addOwningBinary(std::move(ParsedBinary));
- errs() << "HERE: " << __FILE__ << ":" << __LINE__ << ", DbgBin: " << DbgBin << "\n";
if (Bin->isMachO() || Bin->isMachOUniversalBinary()) {
// On Darwin we may find DWARF in separate object file in
// resource directory.
const std::string &ResourcePath =
getDarwinDWARFResourceForPath(Path);
- errs() << "Resource path: " << ResourcePath << "\n";
BinaryOrErr = createBinary(ResourcePath);
std::error_code EC = BinaryOrErr.getError();
- errs() << "HERE: " << __FILE__ << ":" << __LINE__ << ", DbgBin: " << DbgBin << "\n";
if (EC != errc::no_such_file_or_directory && !error(EC)) {
- errs() << "HERE: " << __FILE__ << ":" << __LINE__ << ", DbgBin: " << DbgBin << "\n";
OwningBinary<Binary> B = std::move(BinaryOrErr.get());
DbgBin = B.getBinary().get();
addOwningBinary(std::move(B));
}
- if (EC == errc::no_such_file_or_directory)
- errs() << "no_such_file_or_directory: " << ResourcePath << "\n";
}
- errs() << "HERE: " << __FILE__ << ":" << __LINE__ << ", DbgBin: " << DbgBin << "\n";
// Try to locate the debug binary using .gnu_debuglink section.
if (!DbgBin) {
std::string DebuglinkName;
@@ -342,11 +335,8 @@ LLVMSymbolizer::getOrCreateBinary(const
}
}
}
- errs() << "HERE: " << __FILE__ << ":" << __LINE__ << ", DbgBin: " << DbgBin << "\n";
- if (!DbgBin) {
- errs() << "Failed to open DbgBin, falling back to Bin\n";
+ if (!DbgBin)
DbgBin = Bin;
- }
BinaryPair Res = std::make_pair(Bin, DbgBin);
BinaryForPath[Path] = Res;
return Res;
More information about the llvm-commits
mailing list