[lld] dedb165 - [COFF] Use std::optional in PDB.cpp (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 26 20:56:57 PST 2022


Author: Kazu Hirata
Date: 2022-11-26T20:56:52-08:00
New Revision: dedb16567c2fc46cf5ec167737a47000413fd873

URL: https://github.com/llvm/llvm-project/commit/dedb16567c2fc46cf5ec167737a47000413fd873
DIFF: https://github.com/llvm/llvm-project/commit/dedb16567c2fc46cf5ec167737a47000413fd873.diff

LOG: [COFF] Use std::optional in PDB.cpp (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

Added: 
    

Modified: 
    lld/COFF/PDB.cpp

Removed: 
    


################################################################################
diff  --git a/lld/COFF/PDB.cpp b/lld/COFF/PDB.cpp
index ad1468711ddc..4251549ecc31 100644
--- a/lld/COFF/PDB.cpp
+++ b/lld/COFF/PDB.cpp
@@ -57,6 +57,7 @@
 #include "llvm/Support/Path.h"
 #include "llvm/Support/ScopedPrinter.h"
 #include <memory>
+#include <optional>
 
 using namespace llvm;
 using namespace llvm::codeview;
@@ -1788,8 +1789,8 @@ lld::coff::getFileLineCodeView(const SectionChunk *c, uint32_t addr) {
   if (!findLineTable(c, addr, cvStrTab, checksums, lines, offsetInLinetable))
     return None;
 
-  Optional<uint32_t> nameIndex;
-  Optional<uint32_t> lineNumber;
+  std::optional<uint32_t> nameIndex;
+  std::optional<uint32_t> lineNumber;
   for (const LineColumnEntry &entry : lines) {
     for (const LineNumberEntry &ln : entry.LineNumbers) {
       LineInfo li(ln.Flags);


        


More information about the llvm-commits mailing list