Skip to content

Commit acba675

Browse files
authored
[NFC] Fix SYCLInstallationDetector InstallationCandidates. (#19245)
Originally, SYCLInstallationDetector just had a single constructor parameter D, and filled InstallationCandidates. In the process of upstreaming this, unused arguments HostTriple and Args were added, and InstallationCandidates was removed. Then, when the upstreamed version was pulled into DPC++, we ended up with two constructors, one which did fill InstallationCandidates and one which did not, for no reason. Ideally, we would align with upstream and use that new constructor everywhere. However, we use SYCLInstallationDetector in places where do not have that information, we need to be able to construct a SYCLInstallationDetector from only a Driver, so using only the upstream constructor is not an option. Using only the single-argument constructor is also not a good idea, as it makes future pulldowns more difficult. This is the situation we had, and a pulldown brought us to the current situation where the three-parameter constructor was added to resolve the conflict. Therefore, this commit takes the approach of using the single-parameter constructor to implement the three-parameter constructor, thus ensuring that InstallationCandidates is always filled. This is NFC at the moment because the only places that rely on InstallationCandidates being filled use the single-parameter constructor.
1 parent f6c990e commit acba675

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ SYCLInstallationDetector::SYCLInstallationDetector(const Driver &D)
147147
SYCLInstallationDetector::SYCLInstallationDetector(
148148
const Driver &D, const llvm::Triple &HostTriple,
149149
const llvm::opt::ArgList &Args)
150-
: D(D) {}
150+
: SYCLInstallationDetector(D) {}
151151

152152
static llvm::SmallString<64>
153153
getLibSpirvBasename(const llvm::Triple &DeviceTriple,

0 commit comments

Comments
 (0)