[llvm] r346962 - [X86] Fix MCNullStreamer support for modules with a CodeView flag
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 15 07:17:15 PST 2018
Author: rksimon
Date: Thu Nov 15 07:17:15 2018
New Revision: 346962
URL: http://llvm.org/viewvc/llvm-project?rev=346962&view=rev
Log:
[X86] Fix MCNullStreamer support for modules with a CodeView flag
This fixes -filetype=null support when compiling for a Win32 target and the module has a CodeView flag.
The only places changed are the uses of getTargetStreamer function - this patch guards both of them with null checks.
Committed on behalf of @eush (Eugene Sharygin)
Differential Revision: https://reviews.llvm.org/D54008
Modified:
llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp
llvm/trunk/test/CodeGen/X86/null-streamer.ll
Modified: llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp?rev=346962&r1=346961&r2=346962&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86AsmPrinter.cpp Thu Nov 15 07:17:15 2018
@@ -88,19 +88,19 @@ bool X86AsmPrinter::runOnMachineFunction
void X86AsmPrinter::EmitFunctionBodyStart() {
if (EmitFPOData) {
- X86TargetStreamer *XTS =
- static_cast<X86TargetStreamer *>(OutStreamer->getTargetStreamer());
- unsigned ParamsSize =
- MF->getInfo<X86MachineFunctionInfo>()->getArgumentStackSize();
- XTS->emitFPOProc(CurrentFnSym, ParamsSize);
+ if (auto *XTS =
+ static_cast<X86TargetStreamer *>(OutStreamer->getTargetStreamer()))
+ XTS->emitFPOProc(
+ CurrentFnSym,
+ MF->getInfo<X86MachineFunctionInfo>()->getArgumentStackSize());
}
}
void X86AsmPrinter::EmitFunctionBodyEnd() {
if (EmitFPOData) {
- X86TargetStreamer *XTS =
- static_cast<X86TargetStreamer *>(OutStreamer->getTargetStreamer());
- XTS->emitFPOEndProc();
+ if (auto *XTS =
+ static_cast<X86TargetStreamer *>(OutStreamer->getTargetStreamer()))
+ XTS->emitFPOEndProc();
}
}
Modified: llvm/trunk/test/CodeGen/X86/null-streamer.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/null-streamer.ll?rev=346962&r1=346961&r2=346962&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/null-streamer.ll (original)
+++ llvm/trunk/test/CodeGen/X86/null-streamer.ll Thu Nov 15 07:17:15 2018
@@ -14,7 +14,7 @@ define void @f1() {
}
!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!7, !8}
+!llvm.module.flags = !{!7, !8, !9}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: " ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3, imports: !2)
!1 = !DIFile(filename: "file.c", directory: "")
@@ -25,4 +25,4 @@ define void @f1() {
!6 = !DIBasicType(size: 32, align: 32, encoding: DW_ATE_signed)
!7 = !{i32 2, !"Dwarf Version", i32 3}
!8 = !{i32 1, !"Debug Info Version", i32 3}
-
+!9 = !{i32 2, !"CodeView", i32 1}
More information about the llvm-commits
mailing list