summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-09-09 19:48:37 +0000
committerBill Wendling <isanbard@gmail.com>2013-09-09 19:48:37 +0000
commit550c76dbd68abc17cd32c859de3c24de94ad5cb3 (patch)
tree02b7314fc003a8fbfea797105332710102239dd7 /llvm/lib
parent116868eaddccd6080ca0c564c6d7e44ebebcb3c9 (diff)
downloadbcm5719-llvm-550c76dbd68abc17cd32c859de3c24de94ad5cb3.tar.gz
bcm5719-llvm-550c76dbd68abc17cd32c859de3c24de94ad5cb3.zip
Call generateCompactUnwindEncodings() right before we need to output the frame information.
There are more than one paths to where the frame information is emitted. Place the call to generateCompactUnwindEncodings() into the method which outputs the frame information, thus ensuring that the encoding is there for every path. This involved threading the MCAsmBackend object through to this method. <rdar://problem/13623355> llvm-svn: 190335
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/LLVMTargetMachine.cpp7
-rw-r--r--llvm/lib/MC/MCAsmStreamer.cpp3
-rw-r--r--llvm/lib/MC/MCDwarf.cpp7
-rw-r--r--llvm/lib/MC/MCELFStreamer.cpp2
-rw-r--r--llvm/lib/MC/MCMachOStreamer.cpp3
-rw-r--r--llvm/lib/MC/MCStreamer.cpp14
6 files changed, 18 insertions, 18 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
index 6fd68ee7750..5699511a4de 100644
--- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
@@ -175,12 +175,11 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
// Create a code emitter if asked to show the encoding.
MCCodeEmitter *MCE = 0;
- MCAsmBackend *MAB = 0;
- if (ShowMCEncoding) {
+ if (ShowMCEncoding)
MCE = getTarget().createMCCodeEmitter(MII, MRI, STI, *Context);
- MAB = getTarget().createMCAsmBackend(MRI, getTargetTriple(), TargetCPU);
- }
+ MCAsmBackend *MAB = getTarget().createMCAsmBackend(MRI, getTargetTriple(),
+ TargetCPU);
MCStreamer *S = getTarget().createAsmStreamer(*Context, Out,
getVerboseAsm(),
hasMCUseLoc(),
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp
index 60d72abbcb8..c612a23f953 100644
--- a/llvm/lib/MC/MCAsmStreamer.cpp
+++ b/llvm/lib/MC/MCAsmStreamer.cpp
@@ -1421,8 +1421,9 @@ void MCAsmStreamer::FinishImpl() {
MCGenDwarfInfo::Emit(this, LineSectionSymbol);
if (!UseCFI)
- EmitFrames(false);
+ EmitFrames(AsmBackend.get(), false);
}
+
MCStreamer *llvm::createAsmStreamer(MCContext &Context,
formatted_raw_ostream &OS,
bool isVerboseAsm, bool useLoc,
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index a5528a2d42f..f47553204b2 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -1415,9 +1415,10 @@ namespace llvm {
};
}
-void MCDwarfFrameEmitter::Emit(MCStreamer &Streamer,
- bool UsingCFI,
- bool IsEH) {
+void MCDwarfFrameEmitter::Emit(MCStreamer &Streamer, MCAsmBackend *MAB,
+ bool UsingCFI, bool IsEH) {
+ Streamer.generateCompactUnwindEncodings(MAB);
+
MCContext &Context = Streamer.getContext();
const MCObjectFileInfo *MOFI = Context.getObjectFileInfo();
FrameEmitterImpl Emitter(UsingCFI, IsEH);
diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp
index 4661d503c37..a04352a8b28 100644
--- a/llvm/lib/MC/MCELFStreamer.cpp
+++ b/llvm/lib/MC/MCELFStreamer.cpp
@@ -528,7 +528,7 @@ void MCELFStreamer::EmitBundleUnlock() {
}
void MCELFStreamer::FinishImpl() {
- EmitFrames(true);
+ EmitFrames(NULL, true);
for (std::vector<LocalCommon>::const_iterator i = LocalCommons.begin(),
e = LocalCommons.end();
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index f914f62c2f7..e628461f1d6 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/lib/MC/MCMachOStreamer.cpp
@@ -396,8 +396,7 @@ void MCMachOStreamer::EmitInstToData(const MCInst &Inst) {
}
void MCMachOStreamer::FinishImpl() {
- generateCompactUnwindEncodings(getAssembler().getBackend());
- EmitFrames(true);
+ EmitFrames(&getAssembler().getBackend(), true);
// We have to set the fragment atom associations so we can relax properly for
// Mach-O.
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp
index 806bec98968..c16670ad7ca 100644
--- a/llvm/lib/MC/MCStreamer.cpp
+++ b/llvm/lib/MC/MCStreamer.cpp
@@ -73,12 +73,12 @@ raw_ostream &MCStreamer::GetCommentOS() {
return nulls();
}
-void MCStreamer::generateCompactUnwindEncodings(MCAsmBackend &MAB) {
+void MCStreamer::generateCompactUnwindEncodings(MCAsmBackend *MAB) {
+ if (!MAB) return;
for (std::vector<MCDwarfFrameInfo>::iterator I = FrameInfos.begin(),
E = FrameInfos.end(); I != E; ++I)
- if (!I->CompactUnwindEncoding)
- I->CompactUnwindEncoding =
- MAB.generateCompactUnwindEncoding(I->Instructions);
+ I->CompactUnwindEncoding =
+ MAB->generateCompactUnwindEncoding(I->Instructions);
}
void MCStreamer::EmitDwarfSetLineAddr(int64_t LineDelta,
@@ -604,15 +604,15 @@ void MCStreamer::EmitRawText(const Twine &T) {
EmitRawText(Str.str());
}
-void MCStreamer::EmitFrames(bool usingCFI) {
+void MCStreamer::EmitFrames(MCAsmBackend *MAB, bool usingCFI) {
if (!getNumFrameInfos())
return;
if (EmitEHFrame)
- MCDwarfFrameEmitter::Emit(*this, usingCFI, true);
+ MCDwarfFrameEmitter::Emit(*this, MAB, usingCFI, true);
if (EmitDebugFrame)
- MCDwarfFrameEmitter::Emit(*this, usingCFI, false);
+ MCDwarfFrameEmitter::Emit(*this, MAB, usingCFI, false);
}
void MCStreamer::EmitW64Tables() {
OpenPOWER on IntegriCloud