Skip to content

Commit c533c05

Browse files
committed
Downgrade C++ from 23 to 20
1 parent ddfa5dd commit c533c05

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

llvm/tools/llvm-lsp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ add_llvm_tool(llvm-lsp-server
1414
Protocol.cpp
1515
)
1616

17-
target_compile_features(llvm-lsp-server PRIVATE cxx_std_23)
17+
target_compile_features(llvm-lsp-server PRIVATE cxx_std_20)

llvm/tools/llvm-lsp/IRDocument.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ class IRDocumentHelpers {
3737
static std::optional<std::string>
3838
basicBlockIdFormatter(const llvm::BasicBlock *BB,
3939
const llvm::AsmParserContext &ParserContext) {
40-
return ParserContext.getBlockLocation(BB).transform([](const auto &Loc) {
41-
return llvm::formatv("range_{0}_{1}_{2}_{3}", Loc.Start.Line,
42-
Loc.Start.Col, Loc.End.Line, Loc.End.Col);
43-
});
40+
if (auto Loc = ParserContext.getBlockLocation(BB))
41+
return llvm::formatv("range_{0}_{1}_{2}_{3}", Loc->Start.Line,
42+
Loc->Start.Col, Loc->End.Line, Loc->End.Col);
43+
return std::nullopt;
4444
}
4545

4646
static std::optional<llvm::FileLocRange>

0 commit comments

Comments
 (0)