Skip to content

Commit 02ae8b9

Browse files
svenvhvmaksimo
authored andcommitted
Move some includes from SPIRVDebug.h to .cpp files
Header files should only include the minimum required, to keep build times reasonable.
1 parent c4c20a3 commit 02ae8b9

File tree

8 files changed

+13
-7
lines changed

8 files changed

+13
-7
lines changed

llvm-spirv/lib/SPIRV/OCL20ToSPIRV.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include "llvm/IR/Instruction.h"
5050
#include "llvm/IR/Instructions.h"
5151
#include "llvm/Pass.h"
52+
#include "llvm/Support/Debug.h"
5253

5354
#include <algorithm>
5455
#include <set>

llvm-spirv/lib/SPIRV/OCL21ToSPIRV.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
#include "llvm/IR/InstVisitor.h"
4747
#include "llvm/IR/Instructions.h"
4848
#include "llvm/Pass.h"
49+
#include "llvm/Support/Debug.h"
4950

5051
#include <set>
5152

llvm-spirv/lib/SPIRV/PreprocessMetadata.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include "llvm/IR/IRBuilder.h"
5050
#include "llvm/IR/InstVisitor.h"
5151
#include "llvm/Pass.h"
52+
#include "llvm/Support/CommandLine.h"
5253

5354
using namespace llvm;
5455
using namespace SPIRV;

llvm-spirv/lib/SPIRV/SPIRVLowerConstExpr.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include "llvm/IR/InstVisitor.h"
5050
#include "llvm/IR/Instructions.h"
5151
#include "llvm/Pass.h"
52+
#include "llvm/Support/CommandLine.h"
5253

5354
#include <list>
5455
#include <set>

llvm-spirv/lib/SPIRV/SPIRVLowerSaddWithOverflow.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#include "llvm/IRReader/IRReader.h"
5252
#include "llvm/Linker/Linker.h"
5353
#include "llvm/Pass.h"
54+
#include "llvm/Support/SourceMgr.h"
5455

5556
using namespace llvm;
5657
using namespace SPIRV;

llvm-spirv/lib/SPIRV/SPIRVRegularizeLLVM.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include "llvm/IR/Instructions.h"
4646
#include "llvm/IR/Operator.h"
4747
#include "llvm/Pass.h"
48+
#include "llvm/Support/Debug.h"
4849

4950
#include <set>
5051
#include <vector>

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVDebug.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include "SPIRVDebug.h"
4141

4242
#include "llvm/IR/Verifier.h"
43+
#include "llvm/Support/CommandLine.h"
4344
#include "llvm/Support/raw_ostream.h"
4445

4546
#define DEBUG_TYPE "spirv-regularization"
@@ -51,12 +52,12 @@ SPIRV::SPIRVDbgErrorHandlingKinds SPIRV::SPIRVDbgError =
5152
SPIRVDbgErrorHandlingKinds::Exit;
5253
bool SPIRV::SPIRVDbgErrorMsgIncludesSourceInfo = true;
5354

54-
llvm::cl::opt<bool> SPIRV::VerifyRegularizationPasses(
55+
namespace SPIRV {
56+
llvm::cl::opt<bool> VerifyRegularizationPasses(
5557
"spirv-verify-regularize-passes", llvm::cl::init(_SPIRVDBG),
5658
llvm::cl::desc(
5759
"Verify module after each pass in LLVM regularization phase"));
5860

59-
namespace SPIRV {
6061
void verifyRegularizationPass(llvm::Module &M, const std::string &PassName) {
6162
if (VerifyRegularizationPasses) {
6263
std::string Err;

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVDebug.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,15 @@
4141
#define SPIRV_LIBSPIRV_SPIRVDEBUG_H
4242

4343
#include "SPIRVUtil.h"
44-
#include "llvm/IR/Module.h"
45-
#include "llvm/Support/CommandLine.h"
46-
#include "llvm/Support/Debug.h"
4744

4845
#include <iostream>
4946
#include <string>
5047

51-
namespace SPIRV {
48+
namespace llvm {
49+
class Module;
50+
}
5251

53-
extern llvm::cl::opt<bool> VerifyRegularizationPasses;
52+
namespace SPIRV {
5453

5554
// Include source file and line number in error message.
5655
extern bool SPIRVDbgErrorMsgIncludesSourceInfo;

0 commit comments

Comments
 (0)