diff options
author | Jay Foad <jay.foad@amd.com> | 2024-09-19 16:16:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-19 16:16:38 +0100 |
commit | e03f427196ec67a8a5cfbdd658f9eabe9bce83ce (patch) | |
tree | 5c39989033e45fe09b7d589f923e0b6c9d20f917 /llvm/lib/IR/DebugInfo.cpp | |
parent | 14120227a34365e829d05c1413033d235d7d272c (diff) | |
download | llvm-e03f427196ec67a8a5cfbdd658f9eabe9bce83ce.zip llvm-e03f427196ec67a8a5cfbdd658f9eabe9bce83ce.tar.gz llvm-e03f427196ec67a8a5cfbdd658f9eabe9bce83ce.tar.bz2 |
[LLVM] Use {} instead of std::nullopt to initialize empty ArrayRef (#109133)
It is almost always simpler to use {} instead of std::nullopt to
initialize an empty ArrayRef. This patch changes all occurrences I could
find in LLVM itself. In future the ArrayRef(std::nullopt_t) constructor
could be deprecated or removed.
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index e50b6f6..50b29ae 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -2039,16 +2039,14 @@ static void emitDbgAssign(AssignmentInfo Info, Value *Val, Value *Dest, StoreToWholeVariable = FragStartBit <= VarStartBit && FragEndBit >= *Size; } - DIExpression *Expr = - DIExpression::get(StoreLikeInst.getContext(), std::nullopt); + DIExpression *Expr = DIExpression::get(StoreLikeInst.getContext(), {}); if (!StoreToWholeVariable) { auto R = DIExpression::createFragmentExpression(Expr, FragStartBit, FragEndBit - FragStartBit); assert(R.has_value() && "failed to create fragment expression"); Expr = *R; } - DIExpression *AddrExpr = - DIExpression::get(StoreLikeInst.getContext(), std::nullopt); + DIExpression *AddrExpr = DIExpression::get(StoreLikeInst.getContext(), {}); if (StoreLikeInst.getParent()->IsNewDbgInfoFormat) { auto *Assign = DbgVariableRecord::createLinkedDVRAssign( &StoreLikeInst, Val, VarRec.Var, Expr, Dest, AddrExpr, VarRec.DL); |