summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/ARMAsmPrinter.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-01-31 23:43:14 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-01-31 23:43:14 +0000
commit27aacedf7d975243170206efb948a20d6fd4a2c1 (patch)
tree5f1d4438753c0dddaee0857e509a8d810cd96267 /lib/Target/ARM/ARMAsmPrinter.cpp
parent2d4fd7e6b68753d975d2ed35ccb7ba2ad4483013 (diff)
downloadllvm-27aacedf7d975243170206efb948a20d6fd4a2c1.tar.gz
llvm-27aacedf7d975243170206efb948a20d6fd4a2c1.tar.bz2
llvm-27aacedf7d975243170206efb948a20d6fd4a2c1.tar.xz
Switch the code added in r173885 to use the new, shiny RTTI
infrastructure on MCStreamer to test for whether there is an MCELFStreamer object available. This is just a cleanup on the AsmPrinter side of things, moving ad-hoc tests of random APIs to a direct type query. But the AsmParser completely broken. There were no tests, it just blindly cast its streamer to an MCELFStreamer and started manipulating it. I don't have a test case -- this actually failed on LLVM's own regression test suite. Unfortunately the failure only appears when the stars, compilers, and runtime align to misbehave when we read a pointer to a formatted_raw_ostream as-if it were an MCAssembler. =/ UBSan would catch this immediately. Many thanks to Matt for doing about 80% of the debugging work here in GDB, Jim for helping to explain how exactly to fix this, and others for putting up with the hair pulling that ensued during debugging it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174118 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMAsmPrinter.cpp')
-rw-r--r--lib/Target/ARM/ARMAsmPrinter.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp
index 577cdb09db..986dfb715c 100644
--- a/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -704,12 +704,8 @@ void ARMAsmPrinter::EmitEndOfAsmFile(Module &M) {
// FIXME: This should eventually end up somewhere else where more
// intelligent flag decisions can be made. For now we are just maintaining
// the status quo for ARM and setting EF_ARM_EABI_VER5 as the default.
- if (Subtarget->isTargetELF()) {
- if (OutStreamer.hasRawTextSupport()) return;
-
- MCELFStreamer &MES = static_cast<MCELFStreamer &>(OutStreamer);
- MES.getAssembler().setELFHeaderEFlags(ELF::EF_ARM_EABI_VER5);
- }
+ if (MCELFStreamer *MES = dyn_cast<MCELFStreamer>(&OutStreamer))
+ MES->getAssembler().setELFHeaderEFlags(ELF::EF_ARM_EABI_VER5);
}
//===----------------------------------------------------------------------===//