Skip to content

Commit 369c0a7

Browse files
authored
[clang-repl] Fix target creation in Wasm.cpp (#130909)
Convert the Triple to a string to account for the change from #129868.
1 parent 525d412 commit 369c0a7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clang/lib/Interpreter/Wasm.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ llvm::Error WasmIncrementalExecutor::addModule(PartialTranslationUnit &PTU) {
7373
}
7474

7575
llvm::TargetOptions TO = llvm::TargetOptions();
76-
llvm::TargetMachine *TargetMachine = Target->createTargetMachine(
77-
PTU.TheModule->getTargetTriple(), "", "", TO, llvm::Reloc::Model::PIC_);
76+
llvm::TargetMachine *TargetMachine =
77+
Target->createTargetMachine(PTU.TheModule->getTargetTriple().str(), "",
78+
"", TO, llvm::Reloc::Model::PIC_);
7879
PTU.TheModule->setDataLayout(TargetMachine->createDataLayout());
7980
std::string ObjectFileName = PTU.TheModule->getName().str() + ".o";
8081
std::string BinaryFileName = PTU.TheModule->getName().str() + ".wasm";
@@ -146,4 +147,4 @@ llvm::Error WasmIncrementalExecutor::cleanUp() {
146147

147148
WasmIncrementalExecutor::~WasmIncrementalExecutor() = default;
148149

149-
} // namespace clang
150+
} // namespace clang

0 commit comments

Comments
 (0)