File tree 6 files changed +22
-19
lines changed
clang/lib/Driver/ToolChains 6 files changed +22
-19
lines changed Original file line number Diff line number Diff line change @@ -1094,12 +1094,12 @@ bool Darwin::hasBlocksRuntime() const {
1094
1094
1095
1095
void Darwin::AddCudaIncludeArgs (const ArgList &DriverArgs,
1096
1096
ArgStringList &CC1Args) const {
1097
- CudaInstallation. AddCudaIncludeArgs (DriverArgs, CC1Args);
1097
+ CudaInstallation-> AddCudaIncludeArgs (DriverArgs, CC1Args);
1098
1098
}
1099
1099
1100
1100
void Darwin::AddHIPIncludeArgs (const ArgList &DriverArgs,
1101
1101
ArgStringList &CC1Args) const {
1102
- RocmInstallation. AddHIPIncludeArgs (DriverArgs, CC1Args);
1102
+ RocmInstallation-> AddHIPIncludeArgs (DriverArgs, CC1Args);
1103
1103
}
1104
1104
1105
1105
// This is just a MachO name translation routine and there's no
@@ -3545,6 +3545,6 @@ SanitizerMask Darwin::getSupportedSanitizers() const {
3545
3545
}
3546
3546
3547
3547
void Darwin::printVerboseInfo (raw_ostream &OS) const {
3548
- CudaInstallation. print (OS);
3549
- RocmInstallation. print (OS);
3548
+ CudaInstallation-> print (OS);
3549
+ RocmInstallation-> print (OS);
3550
3550
}
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"
@@ -320,8 +321,8 @@ class LLVM_LIBRARY_VISIBILITY Darwin : public MachO {
320
321
// / The target variant triple that was specified (if any).
321
322
mutable std::optional<llvm::Triple> TargetVariantTriple;
322
323
323
- CudaInstallationDetector CudaInstallation;
324
- RocmInstallationDetector RocmInstallation;
324
+ LazyDetector< CudaInstallationDetector> CudaInstallation;
325
+ LazyDetector< RocmInstallationDetector> RocmInstallation;
325
326
326
327
private:
327
328
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 @@ -590,17 +590,17 @@ SanitizerMask toolchains::MinGW::getSupportedSanitizers() const {
590
590
591
591
void toolchains::MinGW::AddCudaIncludeArgs (const ArgList &DriverArgs,
592
592
ArgStringList &CC1Args) const {
593
- CudaInstallation. AddCudaIncludeArgs (DriverArgs, CC1Args);
593
+ CudaInstallation-> AddCudaIncludeArgs (DriverArgs, CC1Args);
594
594
}
595
595
596
596
void toolchains::MinGW::AddHIPIncludeArgs (const ArgList &DriverArgs,
597
597
ArgStringList &CC1Args) const {
598
- RocmInstallation. AddHIPIncludeArgs (DriverArgs, CC1Args);
598
+ RocmInstallation-> AddHIPIncludeArgs (DriverArgs, CC1Args);
599
599
}
600
600
601
601
void toolchains::MinGW::printVerboseInfo (raw_ostream &OS) const {
602
- CudaInstallation. print (OS);
603
- RocmInstallation. print (OS);
602
+ CudaInstallation-> print (OS);
603
+ RocmInstallation-> print (OS);
604
604
}
605
605
606
606
// 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