Skip to content

Commit 115cf87

Browse files
committed
Address code review feedback.
1 parent bf48915 commit 115cf87

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

llvm/lib/Transforms/Utils/SYCLModuleSplit.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "llvm/IR/PassManager.h"
2222
#include "llvm/IR/PassManagerImpl.h"
2323
#include "llvm/IRPrinter/IRPrintingPasses.h"
24+
#include "llvm/Support/Compiler.h"
2425
#include "llvm/Support/Debug.h"
2526
#include "llvm/Support/Error.h"
2627
#include "llvm/Support/FileSystem.h"
@@ -37,7 +38,7 @@
3738

3839
using namespace llvm;
3940

40-
#define DEBUG_TYPE "sycl_module_split"
41+
#define DEBUG_TYPE "sycl-module-split"
4142

4243
static bool isKernel(const Function &F) {
4344
return F.getCallingConv() == CallingConv::SPIR_KERNEL ||
@@ -75,7 +76,8 @@ struct EntryPointGroup {
7576
EntryPointSet Functions = EntryPointSet())
7677
: GroupName(GroupName), Functions(std::move(Functions)) {}
7778

78-
void dump() const {
79+
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
80+
LLVM_DUMP_METHOD void dump() const {
7981
constexpr size_t INDENT = 4;
8082
dbgs().indent(INDENT) << "ENTRY POINTS"
8183
<< " " << GroupName << " {\n";
@@ -84,6 +86,7 @@ struct EntryPointGroup {
8486

8587
dbgs().indent(INDENT) << "}\n";
8688
}
89+
#endif
8790
};
8891

8992
/// Annotates an llvm::Module with information necessary to perform and track
@@ -133,11 +136,13 @@ class ModuleDesc {
133136
return std::string(ST);
134137
}
135138

136-
void dump() const {
139+
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
140+
LLVM_DUMP_METHOD void dump() const {
137141
dbgs() << "ModuleDesc[" << M->getName() << "] {\n";
138142
EntryPoints.dump();
139143
dbgs() << "}\n";
140144
}
145+
#endif
141146
};
142147

143148
// Represents "dependency" or "use" graph of global objects (functions and

llvm/tools/llvm-split/llvm-split.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
#include "llvm/Transforms/Utils/SYCLUtils.h"
3333
#include "llvm/Transforms/Utils/SplitModule.h"
3434

35-
#include <vector>
3635
#include <string>
36+
#include <vector>
3737

3838
using namespace llvm;
3939

@@ -100,7 +100,7 @@ void writeStringToFile(std::string_view Content, StringRef Path) {
100100
}
101101

102102
void writeSplitModulesAsTable(ArrayRef<SYCLSplitModule> SplitModules,
103-
StringRef Path) {
103+
StringRef Path) {
104104
std::vector<std::string> Columns = {"Code", "Symbols"};
105105
SYCLStringTable Table;
106106
Table.emplace_back(std::move(Columns));

0 commit comments

Comments
 (0)