summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2017-01-02 18:05:27 +0000
committerJoerg Sonnenberger <joerg@bec.de>2017-01-02 18:05:27 +0000
commit7b83732a4025b5a3c652bfb585628104d995df8d (patch)
tree9099e67ddd72dbb8aeef58aa233333b08a806b93 /llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
parent02c6b176e75c650ed1e312541035cb7c086d4da1 (diff)
downloadbcm5719-llvm-7b83732a4025b5a3c652bfb585628104d995df8d.tar.gz
bcm5719-llvm-7b83732a4025b5a3c652bfb585628104d995df8d.zip
Emit .cfi_sections before the first .cfi_startproc
GNU as rejects input where .cfi_sections is used after .cfi_startproc, if the new section differs from the old. Adjust our output to always emit .cfi_sections before the first .cfi_startproc to minimize necessary code. Differential Revision: https://reviews.llvm.org/D28011 llvm-svn: 290817
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/ARMException.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/ARMException.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp b/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
index fff3f003478..0c79def8793 100644
--- a/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
@@ -43,13 +43,6 @@ ARMTargetStreamer &ARMException::getTargetStreamer() {
return static_cast<ARMTargetStreamer &>(TS);
}
-/// endModule - Emit all exception information that should come after the
-/// content.
-void ARMException::endModule() {
- if (shouldEmitCFI)
- Asm->OutStreamer->EmitCFISections(false, true);
-}
-
void ARMException::beginFunction(const MachineFunction *MF) {
if (Asm->MAI->getExceptionHandlingType() == ExceptionHandling::ARM)
getTargetStreamer().emitFnStart();
@@ -57,7 +50,13 @@ void ARMException::beginFunction(const MachineFunction *MF) {
AsmPrinter::CFIMoveType MoveType = Asm->needsCFIMoves();
assert(MoveType != AsmPrinter::CFI_M_EH &&
"non-EH CFI not yet supported in prologue with EHABI lowering");
+
if (MoveType == AsmPrinter::CFI_M_Debug) {
+ if (!hasEmittedCFISections) {
+ Asm->OutStreamer->EmitCFISections(false, true);
+ hasEmittedCFISections = true;
+ }
+
shouldEmitCFI = true;
Asm->OutStreamer->EmitCFIStartProc(false);
}
OpenPOWER on IntegriCloud