Skip to content

Commit e9608d8

Browse files
Fix the setTargetTriple API usage in SPIRV translation (#3930)
This fixes the build with the spirv backend.
1 parent 4a53fb0 commit e9608d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

third_party/intel/lib/Target/SPIRV/SPIRVTranslation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ bool runSpirvBackend(Module *M, std::string &Result, std::string &ErrMsg,
5555
? Triple::spirv64
5656
: Triple::spirv32,
5757
TargetTriple.getSubArch());
58-
M->setTargetTriple(TargetTriple.str());
58+
M->setTargetTriple(TargetTriple);
5959
// We need to reset Data Layout to conform with the TargetMachine
6060
M->setDataLayout("");
6161
}
@@ -64,7 +64,7 @@ bool runSpirvBackend(Module *M, std::string &Result, std::string &ErrMsg,
6464
if (TranslatorOpts.getMaxVersion() != VersionNumber::MaximumVersion) {
6565
TargetTriple.setArch(TargetTriple.getArch(),
6666
spirvVersionToSubArch(TranslatorOpts.getMaxVersion()));
67-
M->setTargetTriple(TargetTriple.str());
67+
M->setTargetTriple(TargetTriple);
6868
}
6969

7070
// Translate the Module into SPIR-V

0 commit comments

Comments
 (0)