Skip to content

Commit db829cd

Browse files
authored
[NFC][LLVM][XRay] Namespace related code cleanup (llvm#163068)
1 parent 9c10b44 commit db829cd

30 files changed

+96
-173
lines changed

llvm/include/llvm/XRay/BlockIndexer.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
#include <cstdint>
2020
#include <vector>
2121

22-
namespace llvm {
23-
namespace xray {
22+
namespace llvm::xray {
2423

2524
// The BlockIndexer will gather all related records associated with a
2625
// process+thread and group them by 'Block'.
@@ -63,7 +62,6 @@ class LLVM_ABI BlockIndexer : public RecordVisitor {
6362
Error flush();
6463
};
6564

66-
} // namespace xray
67-
} // namespace llvm
65+
} // namespace llvm::xray
6866

6967
#endif // LLVM_XRAY_BLOCKINDEXER_H

llvm/include/llvm/XRay/BlockPrinter.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
#include "llvm/XRay/FDRRecords.h"
1919
#include "llvm/XRay/RecordPrinter.h"
2020

21-
namespace llvm {
22-
namespace xray {
21+
namespace llvm::xray {
2322

2423
class LLVM_ABI BlockPrinter : public RecordVisitor {
2524
enum class State {
@@ -55,7 +54,6 @@ class LLVM_ABI BlockPrinter : public RecordVisitor {
5554
void reset() { CurrentState = State::Start; }
5655
};
5756

58-
} // namespace xray
59-
} // namespace llvm
57+
} // namespace llvm::xray
6058

6159
#endif // LLVM_XRAY_BLOCKPRINTER_H

llvm/include/llvm/XRay/BlockVerifier.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
#include "llvm/Support/Compiler.h"
1717
#include "llvm/XRay/FDRRecords.h"
1818

19-
namespace llvm {
20-
namespace xray {
19+
namespace llvm::xray {
2120

2221
class LLVM_ABI BlockVerifier : public RecordVisitor {
2322
public:
@@ -64,7 +63,6 @@ class LLVM_ABI BlockVerifier : public RecordVisitor {
6463
void reset();
6564
};
6665

67-
} // namespace xray
68-
} // namespace llvm
66+
} // namespace llvm::xray
6967

7068
#endif // LLVM_XRAY_BLOCKVERIFIER_H

llvm/include/llvm/XRay/FDRLogBuilder.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010

1111
#include "llvm/XRay/FDRRecords.h"
1212

13-
namespace llvm {
14-
namespace xray {
13+
namespace llvm::xray {
1514

1615
/// The LogBuilder class allows for creating ad-hoc collections of records
1716
/// through the `add<...>(...)` function. An example use of this API is in
@@ -34,7 +33,6 @@ class LogBuilder {
3433
std::vector<std::unique_ptr<Record>> consume() { return std::move(Records); }
3534
};
3635

37-
} // namespace xray
38-
} // namespace llvm
36+
} // namespace llvm::xray
3937

4038
#endif // LLVM_XRAY_FDRLOGBUILDER_H

llvm/include/llvm/XRay/FDRRecordConsumer.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
#include <memory>
1616
#include <vector>
1717

18-
namespace llvm {
19-
namespace xray {
18+
namespace llvm::xray {
2019

2120
class RecordConsumer {
2221
public:
@@ -48,7 +47,6 @@ class LLVM_ABI PipelineConsumer : public RecordConsumer {
4847
Error consume(std::unique_ptr<Record> R) override;
4948
};
5049

51-
} // namespace xray
52-
} // namespace llvm
50+
} // namespace llvm::xray
5351

5452
#endif // LLVM_XRAY_FDRRECORDCONSUMER_H

llvm/include/llvm/XRay/FDRRecordProducer.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
#include "llvm/XRay/XRayRecord.h"
1515
#include <memory>
1616

17-
namespace llvm {
18-
namespace xray {
17+
namespace llvm::xray {
1918

2019
class RecordProducer {
2120
public:
@@ -45,7 +44,6 @@ class LLVM_ABI FileBasedRecordProducer : public RecordProducer {
4544
Expected<std::unique_ptr<Record>> produce() override;
4645
};
4746

48-
} // namespace xray
49-
} // namespace llvm
47+
} // namespace llvm::xray
5048

5149
#endif // LLVM_XRAY_FDRRECORDPRODUCER_H

llvm/include/llvm/XRay/FDRRecords.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
#include "llvm/Support/Error.h"
2424
#include "llvm/XRay/XRayRecord.h"
2525

26-
namespace llvm {
27-
namespace xray {
26+
namespace llvm::xray {
2827

2928
class RecordVisitor;
3029
class RecordInitializer;
@@ -444,7 +443,6 @@ class LLVM_ABI RecordInitializer : public RecordVisitor {
444443
Error visit(TypedEventRecord &) override;
445444
};
446445

447-
} // namespace xray
448-
} // namespace llvm
446+
} // namespace llvm::xray
449447

450448
#endif // LLVM_XRAY_FDRRECORDS_H

llvm/include/llvm/XRay/FDRTraceExpander.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
#include "llvm/XRay/FDRRecords.h"
1818
#include "llvm/XRay/XRayRecord.h"
1919

20-
namespace llvm {
21-
namespace xray {
20+
namespace llvm::xray {
2221

2322
class TraceExpander : public RecordVisitor {
2423
// Type-erased callback for handling individual XRayRecord instances.
@@ -56,7 +55,6 @@ class TraceExpander : public RecordVisitor {
5655
Error flush();
5756
};
5857

59-
} // namespace xray
60-
} // namespace llvm
58+
} // namespace llvm::xray
6159

6260
#endif // LLVM_XRAY_FDRTRACEEXPANDER_H

llvm/include/llvm/XRay/FDRTraceWriter.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
#include "llvm/XRay/FDRRecords.h"
1919
#include "llvm/XRay/XRayRecord.h"
2020

21-
namespace llvm {
22-
namespace xray {
21+
namespace llvm::xray {
2322

2423
/// The FDRTraceWriter allows us to hand-craft an XRay Flight Data Recorder
2524
/// (FDR) mode log file. This is used primarily for testing, generating
@@ -50,7 +49,6 @@ class LLVM_ABI FDRTraceWriter : public RecordVisitor {
5049
support::endian::Writer OS;
5150
};
5251

53-
} // namespace xray
54-
} // namespace llvm
52+
} // namespace llvm::xray
5553

5654
#endif // LLVM_XRAY_FDRTRACEWRITER_H

llvm/include/llvm/XRay/FileHeaderReader.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@
1919
#include "llvm/XRay/XRayRecord.h"
2020
#include <cstdint>
2121

22-
namespace llvm {
23-
namespace xray {
22+
namespace llvm::xray {
2423

2524
/// Convenience function for loading the file header given a data extractor at a
2625
/// specified offset.
2726
LLVM_ABI Expected<XRayFileHeader>
2827
readBinaryFormatHeader(DataExtractor &HeaderExtractor, uint64_t &OffsetPtr);
2928

30-
} // namespace xray
31-
} // namespace llvm
29+
} // namespace llvm::xray
3230

3331
#endif // LLVM_XRAY_FILEHEADERREADER_H

0 commit comments

Comments
 (0)