Skip to content

Commit 802feea

Browse files
svenvhsys-ce-bb
authored andcommitted
Set DEBUG_TYPE after all includes (#2632)
The LLVM Programmer's Manual states that `DEBUG_TYPE` should only be set after the includes. Original commit: KhronosGroup/SPIRV-LLVM-Translator@350569a6621ebba
1 parent f58fc2a commit 802feea

12 files changed

+24
-12
lines changed

llvm-spirv/lib/SPIRV/OCLToSPIRV.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
// friendly IR form for further translation into SPIR-V
3737
//
3838
//===----------------------------------------------------------------------===//
39-
#define DEBUG_TYPE "ocl-to-spv"
4039

4140
#include "OCLToSPIRV.h"
4241
#include "OCLTypeToSPIRV.h"
@@ -55,6 +54,8 @@
5554
#include <regex>
5655
#include <set>
5756

57+
#define DEBUG_TYPE "ocl-to-spv"
58+
5859
using namespace llvm;
5960
using namespace PatternMatch;
6061
using namespace SPIRV;

llvm-spirv/lib/SPIRV/OCLTypeToSPIRV.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
// propagates the mapping to the uses of the kernel arguments.
3939
//
4040
//===----------------------------------------------------------------------===//
41-
#define DEBUG_TYPE "cltytospv"
4241

4342
#include "OCLTypeToSPIRV.h"
4443
#include "OCLUtil.h"
@@ -50,6 +49,8 @@
5049
#include <iterator>
5150
#include <set>
5251

52+
#define DEBUG_TYPE "cltytospv"
53+
5354
using namespace llvm;
5455
using namespace SPIRV;
5556
using namespace OCLUtil;

llvm-spirv/lib/SPIRV/OCLUtil.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
// This file implements OCL utility functions.
3636
//
3737
//===----------------------------------------------------------------------===//
38-
#define DEBUG_TYPE "oclutil"
3938

4039
#include "OCLUtil.h"
4140
#include "SPIRVEntry.h"
@@ -50,6 +49,8 @@
5049
#include "llvm/Support/CommandLine.h"
5150
#include "llvm/Support/Debug.h"
5251

52+
#define DEBUG_TYPE "oclutil"
53+
5354
using namespace llvm;
5455
using namespace SPIRV;
5556

llvm-spirv/lib/SPIRV/PreprocessMetadata.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
// further translation to SPIR-V.
3737
//
3838
//===----------------------------------------------------------------------===//
39-
#define DEBUG_TYPE "clmdtospv"
4039

4140
#include "PreprocessMetadata.h"
4241
#include "OCLUtil.h"
@@ -51,6 +50,8 @@
5150
#include "llvm/Support/CommandLine.h"
5251
#include "llvm/TargetParser/Triple.h"
5352

53+
#define DEBUG_TYPE "clmdtospv"
54+
5455
using namespace llvm;
5556
using namespace SPIRV;
5657
using namespace OCLUtil;

llvm-spirv/lib/SPIRV/SPIRVLowerBool.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@
3535
// This file implements lowering instructions with bool operands.
3636
//
3737
//===----------------------------------------------------------------------===//
38-
#define DEBUG_TYPE "spvbool"
3938

4039
#include "SPIRVLowerBool.h"
4140
#include "SPIRVInternal.h"
4241
#include "libSPIRV/SPIRVDebug.h"
4342

4443
#include "llvm/IR/IRBuilder.h"
4544

45+
#define DEBUG_TYPE "spvbool"
46+
4647
using namespace llvm;
4748
using namespace SPIRV;
4849

llvm-spirv/lib/SPIRV/SPIRVLowerConstExpr.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
// This file implements regularization of LLVM module for SPIR-V.
3636
//
3737
//===----------------------------------------------------------------------===//
38-
#define DEBUG_TYPE "spv-lower-const-expr"
3938

4039
#include "SPIRVLowerConstExpr.h"
4140
#include "OCLUtil.h"
@@ -56,6 +55,8 @@
5655
#include <list>
5756
#include <set>
5857

58+
#define DEBUG_TYPE "spv-lower-const-expr"
59+
5960
using namespace llvm;
6061
using namespace SPIRV;
6162
using namespace OCLUtil;

llvm-spirv/lib/SPIRV/SPIRVLowerLLVMIntrinsic.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
// into basic LLVM operations.
2828
//
2929
//===----------------------------------------------------------------------===//
30-
#define DEBUG_TYPE "spv-lower-llvm_intrinsic"
3130

3231
#include "SPIRVLowerLLVMIntrinsic.h"
3332
#include "LLVMBitreverse.h"
@@ -44,6 +43,8 @@
4443
#include "llvm/Linker/Linker.h"
4544
#include "llvm/Support/SourceMgr.h"
4645

46+
#define DEBUG_TYPE "spv-lower-llvm_intrinsic"
47+
4748
using namespace llvm;
4849
using namespace SPIRV;
4950

llvm-spirv/lib/SPIRV/SPIRVLowerMemmove.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
// This file implements lowering llvm.memmove into several llvm.memcpys.
3636
//
3737
//===----------------------------------------------------------------------===//
38-
#define DEBUG_TYPE "spvmemmove"
3938

4039
#include "SPIRVLowerMemmove.h"
4140
#include "SPIRVInternal.h"
@@ -45,6 +44,8 @@
4544
#include "llvm/IR/IRBuilder.h"
4645
#include "llvm/Transforms/Utils/LowerMemIntrinsics.h"
4746

47+
#define DEBUG_TYPE "spvmemmove"
48+
4849
using namespace llvm;
4950
using namespace SPIRV;
5051

llvm-spirv/lib/SPIRV/SPIRVLowerOCLBlocks.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
// with null pointers.
5454
//
5555
//===----------------------------------------------------------------------===//
56-
#define DEBUG_TYPE "spv-lower-ocl-blocks"
5756

5857
#include "SPIRVLowerOCLBlocks.h"
5958
#include "SPIRVInternal.h"
@@ -63,6 +62,8 @@
6362
#include "llvm/Pass.h"
6463
#include "llvm/Support/Regex.h"
6564

65+
#define DEBUG_TYPE "spv-lower-ocl-blocks"
66+
6667
using namespace llvm;
6768

6869
namespace {

llvm-spirv/lib/SPIRV/SPIRVRegularizeLLVM.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
// This file implements regularization of LLVM module for SPIR-V.
3636
//
3737
//===----------------------------------------------------------------------===//
38-
#define DEBUG_TYPE "spvregular"
3938

4039
#include "SPIRVRegularizeLLVM.h"
4140
#include "OCLUtil.h"
@@ -54,6 +53,8 @@
5453
#include <set>
5554
#include <vector>
5655

56+
#define DEBUG_TYPE "spvregular"
57+
5758
using namespace llvm;
5859
using namespace SPIRV;
5960
using namespace OCLUtil;

llvm-spirv/lib/SPIRV/SPIRVToOCL.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,14 @@
3939
// in this pass as a common functionality for both versions.
4040
//
4141
//===----------------------------------------------------------------------===//
42-
#define DEBUG_TYPE "spvtocl"
4342

4443
#include "SPIRVToOCL.h"
4544
#include "llvm/IR/TypedPointerType.h"
4645
#include "llvm/IR/Verifier.h"
4746
#include "llvm/Support/CommandLine.h"
4847

48+
#define DEBUG_TYPE "spvtocl"
49+
4950
namespace SPIRV {
5051

5152
void SPIRVToOCLBase::visitCallInst(CallInst &CI) {

llvm-spirv/lib/SPIRV/SPIRVToOCL20.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@
3535
// This file implements transform SPIR-V builtins to OCL 2.0 builtins.
3636
//
3737
//===----------------------------------------------------------------------===//
38-
#define DEBUG_TYPE "spvtocl20"
3938

4039
#include "OCLUtil.h"
4140
#include "SPIRVToOCL.h"
4241
#include "llvm/IR/Verifier.h"
4342

43+
#define DEBUG_TYPE "spvtocl20"
44+
4445
namespace SPIRV {
4546

4647
char SPIRVToOCL20Legacy::ID = 0;

0 commit comments

Comments
 (0)