summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-04-24 03:11:14 +0000
committerBill Wendling <isanbard@gmail.com>2013-04-24 03:11:14 +0000
commit4e9fc023c64b7aba36f228c0e47d58097b21fddc (patch)
treedab59eefed17c0dc661890f0fcab9b3d63474e9b /llvm/lib/MC
parent7712f389784738c71bd457f74f684231653df7be (diff)
downloadbcm5719-llvm-4e9fc023c64b7aba36f228c0e47d58097b21fddc.tar.gz
bcm5719-llvm-4e9fc023c64b7aba36f228c0e47d58097b21fddc.zip
Align the __LD,__compact_unwind section.
I know what would be cool! We should align the compact unwind section because aligned data access is faster. <rdar://problem/13723271> llvm-svn: 180171
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/MCDwarf.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index f91cb54e639..18982e9cab4 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -1177,8 +1177,6 @@ void FrameEmitterImpl::EmitCompactUnwind(MCStreamer &Streamer,
if (!DwarfEHFrameOnly && Frame.Lsda)
Encoding |= 0x40000000;
- Streamer.SwitchSection(MOFI->getCompactUnwindSection());
-
// Range Start
unsigned FDEEncoding = MOFI->getFDEEncoding(UsingCFI);
unsigned Size = getSizeForEncoding(Streamer, FDEEncoding);
@@ -1421,7 +1419,6 @@ MCSymbol *FrameEmitterImpl::EmitFDE(MCStreamer &streamer,
}
// Call Frame Instructions
-
EmitCFIInstructions(streamer, frame.Instructions, frame.Begin);
// Padding
@@ -1482,11 +1479,23 @@ void MCDwarfFrameEmitter::Emit(MCStreamer &Streamer,
ArrayRef<MCDwarfFrameInfo> FrameArray = Streamer.getFrameInfos();
// Emit the compact unwind info if available.
- if (IsEH && MOFI->getCompactUnwindSection())
- for (unsigned i = 0, n = Streamer.getNumFrameInfos(); i < n; ++i) {
- const MCDwarfFrameInfo &Frame = Streamer.getFrameInfo(i);
- Emitter.EmitCompactUnwind(Streamer, Frame);
+ if (IsEH && MOFI->getCompactUnwindSection()) {
+ unsigned NumFrameInfos = Streamer.getNumFrameInfos();
+ bool SectionEmitted = false;
+
+ if (NumFrameInfos) {
+ for (unsigned i = 0; i < NumFrameInfos; ++i) {
+ const MCDwarfFrameInfo &Frame = Streamer.getFrameInfo(i);
+ if (Frame.CompactUnwindEncoding == 0) continue;
+ if (!SectionEmitted) {
+ Streamer.SwitchSection(MOFI->getCompactUnwindSection());
+ Streamer.EmitValueToAlignment(Context.getAsmInfo().getPointerSize());
+ SectionEmitted = true;
+ }
+ Emitter.EmitCompactUnwind(Streamer, Frame);
+ }
}
+ }
const MCSection &Section = IsEH ? *MOFI->getEHFrameSection() :
*MOFI->getDwarfFrameSection();
OpenPOWER on IntegriCloud