Skip to content

Commit ce9035f

Browse files
authored
Revert "[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration" (#98593)
Reverts #98075 bots are broken
1 parent 37d3f44 commit ce9035f

File tree

2,327 files changed

+4678
-7567
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,327 files changed

+4678
-7567
lines changed

libc/benchmarks/LibcDefaultImplementations.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#include "LibcFunctionPrototypes.h"
2-
#include "src/__support/macros/config.h"
32
#include "llvm/ADT/ArrayRef.h"
43
#include <cstddef>
54

6-
namespace LIBC_NAMESPACE_DECL {
5+
namespace LIBC_NAMESPACE {
76

87
extern void *memcpy(void *__restrict, const void *__restrict, size_t);
98
extern void *memmove(void *, const void *, size_t);
@@ -12,7 +11,7 @@ extern void bzero(void *, size_t);
1211
extern int memcmp(const void *, const void *, size_t);
1312
extern int bcmp(const void *, const void *, size_t);
1413

15-
} // namespace LIBC_NAMESPACE_DECL
14+
} // namespace LIBC_NAMESPACE
1615

1716
// List of implementations to test.
1817

libc/benchmarks/LibcMemoryBenchmarkMain.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "LibcBenchmark.h"
1111
#include "LibcMemoryBenchmark.h"
1212
#include "MemorySizeDistributions.h"
13-
#include "src/__support/macros/config.h"
1413
#include "llvm/Support/CommandLine.h"
1514
#include "llvm/Support/ErrorHandling.h"
1615
#include "llvm/Support/FileSystem.h"
@@ -22,7 +21,7 @@
2221
#include <cstring>
2322
#include <unistd.h>
2423

25-
namespace LIBC_NAMESPACE_DECL {
24+
namespace LIBC_NAMESPACE {
2625

2726
extern void *memcpy(void *__restrict, const void *__restrict, size_t);
2827
extern void *memmove(void *, const void *, size_t);
@@ -31,7 +30,7 @@ extern void bzero(void *, size_t);
3130
extern int memcmp(const void *, const void *, size_t);
3231
extern int bcmp(const void *, const void *, size_t);
3332

34-
} // namespace LIBC_NAMESPACE_DECL
33+
} // namespace LIBC_NAMESPACE
3534

3635
namespace llvm {
3736
namespace libc_benchmarks {

libc/benchmarks/automemcpy/lib/CodeGen.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
// function at the end of the file.
3737

3838
#include "automemcpy/CodeGen.h"
39-
#include "src/__support/macros/config.h"
4039
#include <cassert>
4140
#include <llvm/ADT/STLExtras.h>
4241
#include <llvm/ADT/StringSet.h>
@@ -543,11 +542,11 @@ static void Serialize(raw_ostream &Stream,
543542
Stream << "using llvm::libc_benchmarks::MemmoveConfiguration;\n";
544543
Stream << "using llvm::libc_benchmarks::MemsetConfiguration;\n";
545544
Stream << "\n";
546-
Stream << "namespace LIBC_NAMESPACE_DECL {\n";
545+
Stream << "namespace LIBC_NAMESPACE {\n";
547546
Stream << "\n";
548547
codegen::functions::Serialize(Stream, Descriptors);
549548
Stream << "\n";
550-
Stream << "} // namespace LIBC_NAMESPACE_DECL\n";
549+
Stream << "} // namespace LIBC_NAMESPACE\n";
551550
Stream << "\n";
552551
Stream << "namespace llvm {\n";
553552
Stream << "namespace automemcpy {\n";

libc/benchmarks/automemcpy/unittests/CodeGenTest.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include "automemcpy/CodeGen.h"
1010
#include "automemcpy/RandomFunctionGenerator.h"
11-
#include "src/__support/macros/config.h"
1211
#include "gmock/gmock.h"
1312
#include "gtest/gtest.h"
1413
#include <optional>
@@ -64,7 +63,7 @@ using llvm::libc_benchmarks::MemcpyConfiguration;
6463
using llvm::libc_benchmarks::MemmoveConfiguration;
6564
using llvm::libc_benchmarks::MemsetConfiguration;
6665
67-
namespace LIBC_NAMESPACE_DECL {
66+
namespace LIBC_NAMESPACE {
6867
6968
static void memcpy_0xE00E29EE73994E2B(char *__restrict dst, const char *__restrict src, size_t size) {
7069
using namespace LIBC_NAMESPACE::x86;
@@ -135,7 +134,7 @@ static void bzero_0x475977492C218AD4(char * dst, size_t size) {
135134
return splat_set<Align<_32,Arg::Dst>::Then<Loop<_32>>>(dst, 0, size);
136135
}
137136
138-
} // namespace LIBC_NAMESPACE_DECL
137+
} // namespace LIBC_NAMESPACE
139138
140139
namespace llvm {
141140
namespace automemcpy {

libc/benchmarks/gpu/BenchmarkLogger.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
#include "src/__support/CPP/string_view.h"
44
#include "src/__support/OSUtil/io.h" // write_to_stderr
55
#include "src/__support/big_int.h" // is_big_int
6-
#include "src/__support/macros/config.h"
76
#include "src/__support/macros/properties/types.h" // LIBC_TYPES_HAS_INT128
87
#include "src/__support/uint128.h"
98

109
#include <stdint.h>
1110

12-
namespace LIBC_NAMESPACE_DECL {
11+
namespace LIBC_NAMESPACE {
1312
namespace benchmarks {
1413

1514
// cpp::string_view specialization
@@ -95,4 +94,4 @@ template BenchmarkLogger &BenchmarkLogger::operator<< <UInt<320>>(UInt<320>);
9594
BenchmarkLogger log;
9695

9796
} // namespace benchmarks
98-
} // namespace LIBC_NAMESPACE_DECL
97+
} // namespace LIBC_NAMESPACE

libc/benchmarks/gpu/BenchmarkLogger.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
#ifndef LLVM_LIBC_BENCHMARKS_GPU_BENCHMARKLOGGER_H
1010
#define LLVM_LIBC_BENCHMARKS_GPU_BENCHMARKLOGGER_H
1111

12-
#include "src/__support/macros/config.h"
13-
14-
namespace LIBC_NAMESPACE_DECL {
12+
namespace LIBC_NAMESPACE {
1513
namespace benchmarks {
1614

1715
// A class to log to standard output in the context of hermetic tests.
@@ -24,6 +22,6 @@ struct BenchmarkLogger {
2422
extern BenchmarkLogger log;
2523

2624
} // namespace benchmarks
27-
} // namespace LIBC_NAMESPACE_DECL
25+
} // namespace LIBC_NAMESPACE
2826

2927
#endif /* LLVM_LIBC_BENCHMARKS_GPU_BENCHMARKLOGGER_H */

libc/benchmarks/gpu/LibcGpuBenchmark.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
#include "src/__support/FPUtil/sqrt.h"
66
#include "src/__support/GPU/utils.h"
77
#include "src/__support/fixedvector.h"
8-
#include "src/__support/macros/config.h"
98
#include "src/time/gpu/time_utils.h"
109

11-
namespace LIBC_NAMESPACE_DECL {
10+
namespace LIBC_NAMESPACE {
1211
namespace benchmarks {
1312

1413
FixedVector<Benchmark *, 64> benchmarks;
@@ -136,4 +135,4 @@ BenchmarkResult benchmark(const BenchmarkOptions &options,
136135
};
137136

138137
} // namespace benchmarks
139-
} // namespace LIBC_NAMESPACE_DECL
138+
} // namespace LIBC_NAMESPACE

libc/benchmarks/gpu/LibcGpuBenchmark.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
#include "src/__support/CPP/functional.h"
77
#include "src/__support/CPP/limits.h"
88
#include "src/__support/CPP/string_view.h"
9-
#include "src/__support/macros/config.h"
109
#include "src/time/clock.h"
1110

1211
#include <stdint.h>
1312

14-
namespace LIBC_NAMESPACE_DECL {
13+
namespace LIBC_NAMESPACE {
1514

1615
namespace benchmarks {
1716

@@ -100,7 +99,7 @@ class Benchmark {
10099
const cpp::string_view get_name() const { return name; }
101100
};
102101
} // namespace benchmarks
103-
} // namespace LIBC_NAMESPACE_DECL
102+
} // namespace LIBC_NAMESPACE
104103

105104
#define BENCHMARK(SuiteName, TestName, Func) \
106105
LIBC_NAMESPACE::benchmarks::Benchmark SuiteName##_##TestName##_Instance( \

libc/benchmarks/gpu/timing/amdgpu/timing.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
else \
2626
asm("" ::"v"(VARIABLE))
2727

28-
namespace LIBC_NAMESPACE_DECL {
28+
namespace LIBC_NAMESPACE {
2929

3030
// Returns the overhead associated with calling the profiling region. This
3131
// allows us to substract the constant-time overhead from the latency to
@@ -107,6 +107,6 @@ template <typename F, typename T1, typename T2>
107107
return stop - start;
108108
}
109109

110-
} // namespace LIBC_NAMESPACE_DECL
110+
} // namespace LIBC_NAMESPACE
111111

112112
#endif // LLVM_LIBC_UTILS_GPU_TIMING_AMDGPU

libc/benchmarks/gpu/timing/nvptx/timing.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include <stdint.h>
1818

19-
namespace LIBC_NAMESPACE_DECL {
19+
namespace LIBC_NAMESPACE {
2020

2121
// Returns the overhead associated with calling the profiling region. This
2222
// allows us to substract the constant-time overhead from the latency to
@@ -94,6 +94,6 @@ static LIBC_INLINE uint64_t latency(F f, T1 t1, T2 t2) {
9494

9595
return stop - start;
9696
}
97-
} // namespace LIBC_NAMESPACE_DECL
97+
} // namespace LIBC_NAMESPACE
9898

9999
#endif // LLVM_LIBC_UTILS_GPU_TIMING_NVPTX

0 commit comments

Comments
 (0)