From 61ddb7df82361db6e30bcfa8b6ceada40a37c34b Mon Sep 17 00:00:00 2001 From: Sanjin Sijaric Date: Sat, 1 Sep 2018 00:33:43 +0000 Subject: [PATCH] Make HasWinCFI a plain bool instead of Optional Summary: Reid suggested making HasWinCFI a plain bool defaulting to false in D50288. It's needed in order to add HasWinCFI to MIRPrinter. Otherwise, we'll get the assertion: HasWinCFI.hasValue() && "HasWinCFI not set yet!"' Also, a few ARM64 Windows test cases will fail with the same assert if the ARM64 MCLayer part of EH work (D50166) goes in before the frame lowering part that sets HasWinCFI (D50288 as of now). Reviewers: rnk, mstorsjo, hans, javed.absar Reviewed By: rnk Subscribers: kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D51560 llvm-svn: 341270 --- llvm/include/llvm/CodeGen/MachineFunction.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/CodeGen/MachineFunction.h b/llvm/include/llvm/CodeGen/MachineFunction.h index 7639012f..1083e39 100644 --- a/llvm/include/llvm/CodeGen/MachineFunction.h +++ b/llvm/include/llvm/CodeGen/MachineFunction.h @@ -294,7 +294,7 @@ class MachineFunction { bool HasInlineAsm = false; /// True if any WinCFI instruction have been emitted in this function. - Optional HasWinCFI; + bool HasWinCFI = false; /// Current high-level properties of the IR of the function (e.g. is in SSA /// form or whether registers have been allocated) @@ -484,8 +484,7 @@ public: } bool hasWinCFI() const { - assert(HasWinCFI.hasValue() && "HasWinCFI not set yet!"); - return *HasWinCFI; + return HasWinCFI; } void setHasWinCFI(bool v) { HasWinCFI = v; } -- 2.7.4