From f4498a4fd327fe75f0b72870bd1740bd92be5a44 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 19 Feb 2015 00:45:04 +0000 Subject: [PATCH] llvm-mc: Use Target::createNullStreamer to fix crashes on target-specific asm directives. llvm-svn: 229798 --- llvm/test/CodeGen/ARM/null-streamer.ll | 2 ++ llvm/tools/llvm-mc/llvm-mc.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/test/CodeGen/ARM/null-streamer.ll b/llvm/test/CodeGen/ARM/null-streamer.ll index 350c45e5bebe..19ad22a4bdb8 100644 --- a/llvm/test/CodeGen/ARM/null-streamer.ll +++ b/llvm/test/CodeGen/ARM/null-streamer.ll @@ -5,3 +5,5 @@ define i32 @main() { entry: ret i32 0 } + +module asm ".fnstart" diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp index 78fe9b72f208..91bacc034587 100644 --- a/llvm/tools/llvm-mc/llvm-mc.cpp +++ b/llvm/tools/llvm-mc/llvm-mc.cpp @@ -465,7 +465,7 @@ int main(int argc, char **argv) { MAB, ShowInst)); } else if (FileType == OFT_Null) { - Str.reset(createNullStreamer(Ctx)); + Str.reset(TheTarget->createNullStreamer(Ctx)); } else { assert(FileType == OFT_ObjectFile && "Invalid file type!"); MCCodeEmitter *CE = TheTarget->createMCCodeEmitter(*MCII, *MRI, *STI, Ctx);