aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2022-12-16 23:41:36 +0000
committerFangrui Song <i@maskray.me>2022-12-16 23:41:36 +0000
commit036e092282f50d65d78a47d3a009e8baf2e74f46 (patch)
treeca169675365b06105d9bfa2a6957f753c80194ec /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
parent7a91e00d915c638bfb4864826bc445211e0e41d7 (diff)
downloadllvm-036e092282f50d65d78a47d3a009e8baf2e74f46.zip
llvm-036e092282f50d65d78a47d3a009e8baf2e74f46.tar.gz
llvm-036e092282f50d65d78a47d3a009e8baf2e74f46.tar.bz2
[CodeGen] std::optional::value => operator*/operator->
value() has undesired exception checking semantics and calls __throw_bad_optional_access in libc++. Moreover, the API is unavailable without _LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS). This fixes LLVMMIRParser, LLVMGlobalISel, LLVMAsmPrinter, LLVMSelectionDAG.
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index e31135e..c89c634 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -2802,7 +2802,7 @@ void CodeViewDebug::emitLocalVariableList(const FunctionInfo &FI,
// If ConstantValue is set we will emit it as a S_CONSTANT instead of a
// S_LOCAL in order to be able to represent it at all.
const DIType *Ty = L.DIVar->getType();
- APSInt Val(L.ConstantValue.value());
+ APSInt Val(*L.ConstantValue);
emitConstantSymbolRecord(Ty, Val, std::string(L.DIVar->getName()));
} else {
emitLocalVariable(FI, L);