mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Update LLVM and switch to std::optional. (#2424)
LLVM's bazel build has changed a bit, so this updates the tree for that. LLVM is also moving `llvm::Optional` to match the standard API, but it seemed simpler to just switch to `std::optional`. Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
co-authored by
Jon Ross-Perkins
parent
16bbdbbdb8
commit
94cf343b05
@@ -5,10 +5,10 @@
|
||||
#include "toolchain/parser/parse_tree.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <optional>
|
||||
|
||||
#include "common/check.h"
|
||||
#include "common/error.h"
|
||||
#include "llvm/ADT/Optional.h"
|
||||
#include "llvm/ADT/Sequence.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "toolchain/lexer/tokenized_buffer.h"
|
||||
@@ -188,7 +188,7 @@ auto ParseTree::Print(llvm::raw_ostream& output, bool preorder) const -> void {
|
||||
output << "]\n";
|
||||
}
|
||||
|
||||
auto ParseTree::Verify() const -> llvm::Optional<Error> {
|
||||
auto ParseTree::Verify() const -> std::optional<Error> {
|
||||
llvm::SmallVector<ParseTree::Node> nodes;
|
||||
// Traverse the tree in postorder.
|
||||
for (Node n : postorder()) {
|
||||
@@ -259,7 +259,7 @@ auto ParseTree::Verify() const -> llvm::Optional<Error> {
|
||||
"TokenizedBuffer has {1} tokens.",
|
||||
node_impls_.size(), tokens_->size()));
|
||||
}
|
||||
return llvm::None;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
auto ParseTree::Node::Print(llvm::raw_ostream& output) const -> void {
|
||||
|
||||
Reference in New Issue
Block a user