Skip to content

Commit

Permalink
Fully qualify using declarations across XLS .cc files.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 687067128
  • Loading branch information
mikex-oss authored and copybara-github committed Oct 17, 2024
1 parent 7e672dd commit c268572
Show file tree
Hide file tree
Showing 48 changed files with 136 additions and 136 deletions.
6 changes: 3 additions & 3 deletions xls/codegen/block_inlining_pass_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ namespace m = xls::op_matchers;
namespace xls::verilog {
namespace {
using Instantiation = xls::Instantiation;
using testing::IsEmpty;
using testing::Pair;
using testing::UnorderedElementsAre;
using ::testing::IsEmpty;
using ::testing::Pair;
using ::testing::UnorderedElementsAre;

class BlockInliningPassTest : public IrTestBase {};

Expand Down
6 changes: 3 additions & 3 deletions xls/codegen/register_chaining_analysis_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
#include "xls/ir/register.h"
#include "xls/ir/source_location.h"

using testing::AnyOf;
using testing::ElementsAre;
using testing::UnorderedElementsAre;
using ::testing::AnyOf;
using ::testing::ElementsAre;
using ::testing::UnorderedElementsAre;

namespace xls::verilog {
namespace {
Expand Down
4 changes: 2 additions & 2 deletions xls/common/comparison_utils_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
namespace xls {
namespace {

using testing::HasSubstr;
using testing::IsEmpty;
using ::testing::HasSubstr;
using ::testing::IsEmpty;

TEST(ComparisonUtilsTest, CompareBool) {
EXPECT_THAT(::xls::Compare("boolean", true, true), IsEmpty());
Expand Down
4 changes: 2 additions & 2 deletions xls/common/iter_util_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

namespace xls {
namespace {
using testing::ElementsAreArray;
using testing::IsEmpty;
using ::testing::ElementsAreArray;
using ::testing::IsEmpty;

struct Tup {
int a;
Expand Down
2 changes: 1 addition & 1 deletion xls/common/proto_test_utils_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

namespace xls::proto_testing {
namespace {
using testing::Not;
using ::testing::Not;

Foo MakeFoo(std::string_view sv) {
Foo foo;
Expand Down
2 changes: 1 addition & 1 deletion xls/common/to_string_utils_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
namespace xls {
namespace {

using testing::StrEq;
using ::testing::StrEq;

TEST(ToStringHelpersTest, ToStringBool) {
EXPECT_THAT(::xls::ToString(true), StrEq("true"));
Expand Down
2 changes: 1 addition & 1 deletion xls/contrib/mlir/transforms/instantiate_eprocs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace mlir::xls {
#include "xls/contrib/mlir/transforms/passes.h.inc"

namespace {
using llvm::StringRef;
using ::llvm::StringRef;

class InstantiateEprocsPass
: public impl::InstantiateEprocsPassBase<InstantiateEprocsPass> {
Expand Down
4 changes: 2 additions & 2 deletions xls/contrib/mlir/transforms/normalize_xls_calls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ namespace mlir::xls {

namespace {

using llvm::dyn_cast;
using llvm::StringRef;
using ::llvm::dyn_cast;
using ::llvm::StringRef;

class NormalizeXlsCallsPass
: public impl::NormalizeXlsCallsPassBase<NormalizeXlsCallsPass> {
Expand Down
8 changes: 4 additions & 4 deletions xls/contrib/mlir/transforms/proc_elaboration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ namespace mlir::xls {

namespace {

using llvm::ArrayRef;
using llvm::SmallString;
using llvm::StringRef;
using llvm::StringSet;
using ::llvm::ArrayRef;
using ::llvm::SmallString;
using ::llvm::StringRef;
using ::llvm::StringSet;

// Replaces all structured channel ops in a region with the corresponding
// unstructured channel op (ssend -> send, etc). The channel map is a mapping
Expand Down
2 changes: 1 addition & 1 deletion xls/contrib/xlscc/examples/delay_raw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ using ac_int = XlsInt<Width, Signed>;
#define DELAY 2048
#define MEMORY_SIZE static_cast<uint32_t>(DELAY)

using std::uint32_t;
using ::std::uint32_t;

using memory_t = uint32_t;
using addr_t = ac_int<11, /*signed=*/false>;
Expand Down
6 changes: 3 additions & 3 deletions xls/contrib/xlscc/translate_block.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
#include "xls/ir/value.h"
#include "xls/ir/value_utils.h"

using std::shared_ptr;
using std::string;
using std::vector;
using ::std::shared_ptr;
using ::std::string;
using ::std::vector;

namespace xlscc {

Expand Down
6 changes: 3 additions & 3 deletions xls/contrib/xlscc/translate_loops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
#include "xls/solvers/z3_utils.h"
#include "external/z3/src/api/z3_api.h"

using std::shared_ptr;
using std::string;
using std::vector;
using ::std::shared_ptr;
using ::std::string;
using ::std::vector;

ABSL_FLAG(bool, log_slow_unroll_iterations, false,
"If true, log warnings when unrolling is slow.");
Expand Down
10 changes: 5 additions & 5 deletions xls/contrib/xlscc/translator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@
#include "external/z3/src/api/z3_api.h"
#include "re2/re2.h"

using std::list;
using std::ostringstream;
using std::shared_ptr;
using std::string;
using std::vector;
using ::std::list;
using ::std::ostringstream;
using ::std::shared_ptr;
using ::std::string;
using ::std::vector;

namespace {
template <typename Lambda>
Expand Down
6 changes: 3 additions & 3 deletions xls/contrib/xlscc/translator_types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
#include "xls/ir/type.h"
#include "xls/ir/value.h"

using std::shared_ptr;
using std::string;
using std::vector;
using ::std::shared_ptr;
using ::std::string;
using ::std::vector;

namespace xlscc {

Expand Down
2 changes: 1 addition & 1 deletion xls/contrib/xlscc/unit_tests/unit_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
#include "xls/ir/value.h"
#include "xls/ir/value_utils.h"

using testing::Optional;
using ::testing::Optional;

const int determinism_test_repeat_count = 3;

Expand Down
2 changes: 1 addition & 1 deletion xls/data_structures/algorithm_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
namespace xls {
namespace {

using testing::ElementsAre;
using ::testing::ElementsAre;

TEST(NodeUtilTest, IndicesWhere) {
EXPECT_THAT(IndicesWhere<int>({2, 5, 7, 4, -1}, [](int i) { return i > 3; }),
Expand Down
2 changes: 1 addition & 1 deletion xls/data_structures/inline_bitmap_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
namespace xls {
namespace {

using testing::ElementsAre;
using ::testing::ElementsAre;

TEST(InlineBitmapTest, FromWord) {
{
Expand Down
6 changes: 3 additions & 3 deletions xls/dev_tools/extract_interface_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@

namespace xls {
namespace {
using proto_testing::EqualsProto;
using proto_testing::IgnoringRepeatedFieldOrdering;
using proto_testing::Partially;
using ::xls::proto_testing::EqualsProto;
using ::xls::proto_testing::IgnoringRepeatedFieldOrdering;
using ::xls::proto_testing::Partially;

auto ProtoEquivalent(auto inner) {
return Partially(IgnoringRepeatedFieldOrdering(EqualsProto(inner)));
Expand Down
2 changes: 1 addition & 1 deletion xls/dev_tools/extract_segment_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace {

class ExtractSegmentTest : public IrTestBase {};

using testing::UnorderedElementsAre;
using ::testing::UnorderedElementsAre;

TEST_F(ExtractSegmentTest, FromSource) {
auto p = CreatePackage();
Expand Down
28 changes: 14 additions & 14 deletions xls/dslx/fmt/pretty_print.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@
namespace xls::dslx {
namespace {

using pprint_internal::Align;
using pprint_internal::Concat;
using pprint_internal::Doc;
using pprint_internal::FlatChoice;
using pprint_internal::Group;
using pprint_internal::HardLine;
using pprint_internal::InfinityRequirement;
using pprint_internal::IsInfinite;
using pprint_internal::ModeSelect;
using pprint_internal::Nest;
using pprint_internal::NestIfFlatFits;
using pprint_internal::PrefixedReflow;
using pprint_internal::ReduceTextWidth;
using pprint_internal::Requirement;
using ::xls::dslx::pprint_internal::Align;
using ::xls::dslx::pprint_internal::Concat;
using ::xls::dslx::pprint_internal::Doc;
using ::xls::dslx::pprint_internal::FlatChoice;
using ::xls::dslx::pprint_internal::Group;
using ::xls::dslx::pprint_internal::HardLine;
using ::xls::dslx::pprint_internal::InfinityRequirement;
using ::xls::dslx::pprint_internal::IsInfinite;
using ::xls::dslx::pprint_internal::ModeSelect;
using ::xls::dslx::pprint_internal::Nest;
using ::xls::dslx::pprint_internal::NestIfFlatFits;
using ::xls::dslx::pprint_internal::PrefixedReflow;
using ::xls::dslx::pprint_internal::ReduceTextWidth;
using ::xls::dslx::pprint_internal::Requirement;

Requirement operator+(Requirement lhs, Requirement rhs) {
if (std::holds_alternative<int64_t>(lhs) &&
Expand Down
2 changes: 1 addition & 1 deletion xls/dslx/ir_convert/function_converter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

namespace xls::dslx {
namespace {
using proto_testing::EqualsProto;
using ::xls::proto_testing::EqualsProto;

constexpr std::string_view kTestName = "function_converter_test";
constexpr std::string_view kTestdataPath = "xls/dslx/ir_convert/testdata";
Expand Down
10 changes: 5 additions & 5 deletions xls/dslx/lsp/dslx_ls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ namespace {

namespace fs = std::filesystem;

using verible::lsp::BufferCollection;
using verible::lsp::EditTextBuffer;
using verible::lsp::InitializeResult;
using verible::lsp::JsonRpcDispatcher;
using verible::lsp::MessageStreamSplitter;
using ::verible::lsp::BufferCollection;
using ::verible::lsp::EditTextBuffer;
using ::verible::lsp::InitializeResult;
using ::verible::lsp::JsonRpcDispatcher;
using ::verible::lsp::MessageStreamSplitter;

// The "initialize" method requests server capabilities.
InitializeResult InitializeServer(const nlohmann::json& params) {
Expand Down
2 changes: 1 addition & 1 deletion xls/dslx/stdlib/tests/float32_add_bounds.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ constexpr const char kIrPath[] = "xls/dslx/stdlib/float32_add.ir";
constexpr const char kOptIrPath[] = "xls/dslx/stdlib/float32_add.opt.ir";
constexpr const char kFunctionName[] = "__float32__add";

using solvers::z3::IrTranslator;
using ::xls::solvers::z3::IrTranslator;

// Adds an error comparison to the translated XLS function. To do so:
// - We convert the input arguments into Z3 floating-point types.
Expand Down
4 changes: 2 additions & 2 deletions xls/dslx/type_system/zip_types_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
namespace xls::dslx {
namespace {

using testing::ElementsAre;
using testing::FieldsAre;
using ::testing::ElementsAre;
using ::testing::FieldsAre;

enum class CallbackKind : uint8_t {
kAggregateStart,
Expand Down
2 changes: 1 addition & 1 deletion xls/examples/matmul_4x4/matmul_4x4_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace {

constexpr const char kIrPath[] = "xls/examples/matmul_4x4/matmul_4x4.ir";

using testing::Optional;
using ::testing::Optional;

Value GetX0Value() {
static int iter = 0;
Expand Down
4 changes: 2 additions & 2 deletions xls/flows/ir_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
#include "xls/passes/optimization_pass_pipeline.h"

namespace xls {
using dslx::Module;
using dslx::TypecheckedModule;
using ::xls::dslx::Module;
using ::xls::dslx::TypecheckedModule;

absl::StatusOr<JitChannelQueueWrapper> JitChannelQueueWrapper::Create(
JitChannelQueue* queue, JitRuntime* jit_runtime) {
Expand Down
4 changes: 2 additions & 2 deletions xls/fuzzer/dslx_mutator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include "xls/dslx/frontend/scanner.h"
#include "xls/dslx/frontend/token.h"

using absl::InvalidArgumentError;
using absl::StatusOr;
using ::absl::InvalidArgumentError;
using ::absl::StatusOr;

namespace xls::dslx {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion xls/fuzzer/sample.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

namespace xls {

using dslx::InterpValue;
using ::xls::dslx::InterpValue;

namespace {

Expand Down
24 changes: 12 additions & 12 deletions xls/fuzzer/sample_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@
namespace xls {
namespace {

using dslx::AstGenerator;
using dslx::AstGeneratorOptions;
using dslx::AstNode;
using dslx::AstNodeVisitorWithDefault;
using dslx::FunctionType;
using dslx::ImportData;
using dslx::InterpValue;
using dslx::Module;
using dslx::ModuleMember;
using dslx::ParseModule;
using dslx::Type;
using dslx::TypecheckedModule;
using ::xls::dslx::AstGenerator;
using ::xls::dslx::AstGeneratorOptions;
using ::xls::dslx::AstNode;
using ::xls::dslx::AstNodeVisitorWithDefault;
using ::xls::dslx::FunctionType;
using ::xls::dslx::ImportData;
using ::xls::dslx::InterpValue;
using ::xls::dslx::Module;
using ::xls::dslx::ModuleMember;
using ::xls::dslx::ParseModule;
using ::xls::dslx::Type;
using ::xls::dslx::TypecheckedModule;

class HasNonBlockingRecvVisitor : public AstNodeVisitorWithDefault {
public:
Expand Down
14 changes: 7 additions & 7 deletions xls/fuzzer/value_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
namespace xls {

// keep-sorted start
using dslx::ConstantDef;
using dslx::Expr;
using dslx::InterpValue;
using dslx::InterpValueTag;
using dslx::Module;
using dslx::Number;
using dslx::TypeAnnotation;
using ::xls::dslx::ConstantDef;
using ::xls::dslx::Expr;
using ::xls::dslx::InterpValue;
using ::xls::dslx::InterpValueTag;
using ::xls::dslx::Module;
using ::xls::dslx::Number;
using ::xls::dslx::TypeAnnotation;
// keep-sorted end

namespace {
Expand Down
4 changes: 2 additions & 2 deletions xls/ir/code_template_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
#include "xls/common/status/matchers.h"

using ::absl_testing::StatusIs;
using testing::ElementsAre;
using testing::HasSubstr;
using ::testing::ElementsAre;
using ::testing::HasSubstr;

namespace xls {

Expand Down
Loading

0 comments on commit c268572

Please sign in to comment.