Skip to content

Commit

Permalink
Merge pull request #2330 from hzeller/feature-20250115-ready-for-newe…
Browse files Browse the repository at this point in the history
…r-absl

Prepare code to be ready for abseil-cpp > 20240116
  • Loading branch information
hzeller authored Jan 16, 2025
2 parents 85f511d + b6219b6 commit f9d9743
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 2 deletions.
1 change: 1 addition & 0 deletions verible/common/formatting/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ cc_library(
"//verible/common/util:tree-operations",
"//verible/common/util:value-saver",
"//verible/common/util:vector-tree",
"@abseil-cpp//absl/base:config",
"@abseil-cpp//absl/container:fixed_array",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/strings",
Expand Down
5 changes: 5 additions & 0 deletions verible/common/formatting/layout-optimizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <ostream>
#include <utility>

#include "absl/base/config.h"
#include "absl/container/fixed_array.h"
#include "absl/log/log.h"
#include "verible/common/formatting/basic-format-style.h"
Expand All @@ -40,6 +41,10 @@
#include "verible/common/util/tree-operations.h"
#include "verible/common/util/value-saver.h"

#if ABSL_LTS_RELEASE_VERSION > 20240200
#include "absl/log/vlog_is_on.h"
#endif

namespace verible {

void OptimizeTokenPartitionTree(const BasicFormatStyle &style,
Expand Down
5 changes: 4 additions & 1 deletion verible/common/lsp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ cc_library(
srcs = ["lsp-file-utils.cc"],
hdrs = ["lsp-file-utils.h"],
visibility = ["//visibility:public"],
deps = ["@abseil-cpp//absl/strings"],
deps = [
"@abseil-cpp//absl/base:config",
"@abseil-cpp//absl/strings",
],
)

cc_test(
Expand Down
8 changes: 7 additions & 1 deletion verible/common/lsp/lsp-file-utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <string>
#include <string_view>

#include "absl/base/config.h"
#include "absl/strings/escaping.h"
#include "absl/strings/match.h"
#include "absl/strings/str_cat.h"
Expand Down Expand Up @@ -56,7 +57,12 @@ std::string DecodeURI(std::string_view uri) {
pos++;
if (pos + 2 <= uri.size() && std::isxdigit(uri[pos]) &&
std::isxdigit(uri[pos + 1])) {
std::string hex = absl::HexStringToBytes(uri.substr(pos, 2));
std::string hex;
#if ABSL_LTS_RELEASE_VERSION > 20240200
if (!absl::HexStringToBytes(uri.substr(pos, 2), &hex)) break;
#else
hex = absl::HexStringToBytes(uri.substr(pos, 2));
#endif
absl::StrAppend(&result, hex.length() == 1 ? hex : uri.substr(pos, 2));
pos += 2;
} else {
Expand Down
2 changes: 2 additions & 0 deletions verible/verilog/analysis/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ cc_library(
"//verible/verilog/parser:verilog-token-classifications",
"//verible/verilog/parser:verilog-token-enum",
"//verible/verilog/preprocessor:verilog-preprocess",
"@abseil-cpp//absl/base:config",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/status",
"@abseil-cpp//absl/strings",
Expand Down Expand Up @@ -263,6 +264,7 @@ cc_library(
"//verible/common/util:status-macros",
"//verible/verilog/parser:verilog-token-classifications",
"//verible/verilog/parser:verilog-token-enum",
"@abseil-cpp//absl/base:config",
"@abseil-cpp//absl/flags:flag",
"@abseil-cpp//absl/log",
"@abseil-cpp//absl/status",
Expand Down
5 changes: 5 additions & 0 deletions verible/verilog/analysis/verilog-analyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <string_view>
#include <vector>

#include "absl/base/config.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
#include "absl/strings/str_cat.h"
Expand All @@ -48,6 +49,10 @@
#include "verible/verilog/parser/verilog-token-enum.h"
#include "verible/verilog/preprocessor/verilog-preprocess.h"

#if ABSL_LTS_RELEASE_VERSION > 20240200
#include "absl/log/vlog_is_on.h"
#endif

namespace verilog {

using verible::TokenInfo;
Expand Down
5 changes: 5 additions & 0 deletions verible/verilog/analysis/verilog-linter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <utility>
#include <vector>

#include "absl/base/config.h"
#include "absl/flags/flag.h"
#include "absl/log/log.h"
#include "absl/status/status.h"
Expand Down Expand Up @@ -55,6 +56,10 @@
#include "verible/verilog/parser/verilog-token-classifications.h"
#include "verible/verilog/parser/verilog-token-enum.h"

#if ABSL_LTS_RELEASE_VERSION > 20240200
#include "absl/log/vlog_is_on.h"
#endif

// TODO(hzeller): make --rules repeatable and cumulative

ABSL_FLAG(verilog::RuleBundle, rules, {},
Expand Down
1 change: 1 addition & 0 deletions verible/verilog/tools/ls/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ cc_library(
"//verible/verilog/analysis:verilog-analyzer",
"//verible/verilog/analysis:verilog-filelist",
"//verible/verilog/analysis:verilog-project",
"@abseil-cpp//absl/base:config",
"@abseil-cpp//absl/container:flat_hash_map",
"@abseil-cpp//absl/flags:flag",
"@abseil-cpp//absl/log",
Expand Down
5 changes: 5 additions & 0 deletions verible/verilog/tools/ls/symbol-table-handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <string_view>
#include <vector>

#include "absl/base/config.h"
#include "absl/container/flat_hash_map.h"
#include "absl/flags/flag.h"
#include "absl/log/log.h"
Expand All @@ -49,6 +50,10 @@
#include "verible/verilog/tools/ls/lsp-conversion.h"
#include "verible/verilog/tools/ls/lsp-parse-buffer.h"

#if ABSL_LTS_RELEASE_VERSION > 20240200
#include "absl/log/vlog_is_on.h"
#endif

ABSL_FLAG(std::string, file_list_path, "verible.filelist",
"Name of the file with Verible FileList for the project");

Expand Down

0 comments on commit f9d9743

Please sign in to comment.