File tree Expand file tree Collapse file tree 6 files changed +22
-19
lines changed
clang/lib/Driver/ToolChains Expand file tree Collapse file tree 6 files changed +22
-19
lines changed Original file line number Diff line number Diff line change @@ -985,12 +985,12 @@ bool Darwin::hasBlocksRuntime() const {
985
985
986
986
void Darwin::AddCudaIncludeArgs (const ArgList &DriverArgs,
987
987
ArgStringList &CC1Args) const {
988
- CudaInstallation. AddCudaIncludeArgs (DriverArgs, CC1Args);
988
+ CudaInstallation-> AddCudaIncludeArgs (DriverArgs, CC1Args);
989
989
}
990
990
991
991
void Darwin::AddHIPIncludeArgs (const ArgList &DriverArgs,
992
992
ArgStringList &CC1Args) const {
993
- RocmInstallation. AddHIPIncludeArgs (DriverArgs, CC1Args);
993
+ RocmInstallation-> AddHIPIncludeArgs (DriverArgs, CC1Args);
994
994
}
995
995
996
996
// This is just a MachO name translation routine and there's no
@@ -3436,6 +3436,6 @@ SanitizerMask Darwin::getSupportedSanitizers() const {
3436
3436
}
3437
3437
3438
3438
void Darwin::printVerboseInfo (raw_ostream &OS) const {
3439
- CudaInstallation. print (OS);
3440
- RocmInstallation. print (OS);
3439
+ CudaInstallation-> print (OS);
3440
+ RocmInstallation-> print (OS);
3441
3441
}
Original file line number Diff line number Diff line change 10
10
#define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_DARWIN_H
11
11
12
12
#include " Cuda.h"
13
+ #include " LazyDetector.h"
13
14
#include " ROCm.h"
14
15
#include " clang/Basic/DarwinSDKInfo.h"
15
16
#include " clang/Basic/LangOptions.h"
@@ -321,8 +322,8 @@ class LLVM_LIBRARY_VISIBILITY Darwin : public MachO {
321
322
// / The target variant triple that was specified (if any).
322
323
mutable std::optional<llvm::Triple> TargetVariantTriple;
323
324
324
- CudaInstallationDetector CudaInstallation;
325
- RocmInstallationDetector RocmInstallation;
325
+ LazyDetector< CudaInstallationDetector> CudaInstallation;
326
+ LazyDetector< RocmInstallationDetector> RocmInstallation;
326
327
327
328
private:
328
329
void AddDeploymentTarget (llvm::opt::DerivedArgList &Args) const ;
Original file line number Diff line number Diff line change @@ -495,24 +495,24 @@ bool MSVCToolChain::isPICDefaultForced() const {
495
495
496
496
void MSVCToolChain::AddCudaIncludeArgs (const ArgList &DriverArgs,
497
497
ArgStringList &CC1Args) const {
498
- CudaInstallation. AddCudaIncludeArgs (DriverArgs, CC1Args);
498
+ CudaInstallation-> AddCudaIncludeArgs (DriverArgs, CC1Args);
499
499
}
500
500
501
501
void MSVCToolChain::AddHIPIncludeArgs (const ArgList &DriverArgs,
502
502
ArgStringList &CC1Args) const {
503
- RocmInstallation. AddHIPIncludeArgs (DriverArgs, CC1Args);
503
+ RocmInstallation-> AddHIPIncludeArgs (DriverArgs, CC1Args);
504
504
}
505
505
506
506
void MSVCToolChain::AddHIPRuntimeLibArgs (const ArgList &Args,
507
507
ArgStringList &CmdArgs) const {
508
508
CmdArgs.append ({Args.MakeArgString (StringRef (" -libpath:" ) +
509
- RocmInstallation. getLibPath ()),
509
+ RocmInstallation-> getLibPath ()),
510
510
" amdhip64.lib" });
511
511
}
512
512
513
513
void MSVCToolChain::printVerboseInfo (raw_ostream &OS) const {
514
- CudaInstallation. print (OS);
515
- RocmInstallation. print (OS);
514
+ CudaInstallation-> print (OS);
515
+ RocmInstallation-> print (OS);
516
516
}
517
517
518
518
std::string
Original file line number Diff line number Diff line change 11
11
12
12
#include " AMDGPU.h"
13
13
#include " Cuda.h"
14
+ #include " LazyDetector.h"
14
15
#include " clang/Driver/Compilation.h"
15
16
#include " clang/Driver/Tool.h"
16
17
#include " clang/Driver/ToolChain.h"
@@ -136,8 +137,8 @@ class LLVM_LIBRARY_VISIBILITY MSVCToolChain : public ToolChain {
136
137
std::optional<llvm::StringRef> WinSdkDir, WinSdkVersion, WinSysRoot;
137
138
std::string VCToolChainPath;
138
139
llvm::ToolsetLayout VSLayout = llvm::ToolsetLayout::OlderVS;
139
- CudaInstallationDetector CudaInstallation;
140
- RocmInstallationDetector RocmInstallation;
140
+ LazyDetector< CudaInstallationDetector> CudaInstallation;
141
+ LazyDetector< RocmInstallationDetector> RocmInstallation;
141
142
};
142
143
143
144
} // end namespace toolchains
Original file line number Diff line number Diff line change @@ -614,17 +614,17 @@ SanitizerMask toolchains::MinGW::getSupportedSanitizers() const {
614
614
615
615
void toolchains::MinGW::AddCudaIncludeArgs (const ArgList &DriverArgs,
616
616
ArgStringList &CC1Args) const {
617
- CudaInstallation. AddCudaIncludeArgs (DriverArgs, CC1Args);
617
+ CudaInstallation-> AddCudaIncludeArgs (DriverArgs, CC1Args);
618
618
}
619
619
620
620
void toolchains::MinGW::AddHIPIncludeArgs (const ArgList &DriverArgs,
621
621
ArgStringList &CC1Args) const {
622
- RocmInstallation. AddHIPIncludeArgs (DriverArgs, CC1Args);
622
+ RocmInstallation-> AddHIPIncludeArgs (DriverArgs, CC1Args);
623
623
}
624
624
625
625
void toolchains::MinGW::printVerboseInfo (raw_ostream &OS) const {
626
- CudaInstallation. print (OS);
627
- RocmInstallation. print (OS);
626
+ CudaInstallation-> print (OS);
627
+ RocmInstallation-> print (OS);
628
628
}
629
629
630
630
// Include directories for various hosts:
Original file line number Diff line number Diff line change 11
11
12
12
#include " Cuda.h"
13
13
#include " Gnu.h"
14
+ #include " LazyDetector.h"
14
15
#include " ROCm.h"
15
16
#include " clang/Driver/Tool.h"
16
17
#include " clang/Driver/ToolChain.h"
@@ -102,8 +103,8 @@ class LLVM_LIBRARY_VISIBILITY MinGW : public ToolChain {
102
103
Tool *buildAssembler () const override ;
103
104
104
105
private:
105
- CudaInstallationDetector CudaInstallation;
106
- RocmInstallationDetector RocmInstallation;
106
+ LazyDetector< CudaInstallationDetector> CudaInstallation;
107
+ LazyDetector< RocmInstallationDetector> RocmInstallation;
107
108
108
109
std::string Base;
109
110
std::string GccLibDir;
You can’t perform that action at this time.
0 commit comments