diff --git a/clang/lib/Interpreter/Wasm.cpp b/clang/lib/Interpreter/Wasm.cpp index aa10b160ccf84..6f584fab52ba9 100644 --- a/clang/lib/Interpreter/Wasm.cpp +++ b/clang/lib/Interpreter/Wasm.cpp @@ -73,8 +73,9 @@ llvm::Error WasmIncrementalExecutor::addModule(PartialTranslationUnit &PTU) { } llvm::TargetOptions TO = llvm::TargetOptions(); - llvm::TargetMachine *TargetMachine = Target->createTargetMachine( - PTU.TheModule->getTargetTriple(), "", "", TO, llvm::Reloc::Model::PIC_); + llvm::TargetMachine *TargetMachine = + Target->createTargetMachine(PTU.TheModule->getTargetTriple().str(), "", + "", TO, llvm::Reloc::Model::PIC_); PTU.TheModule->setDataLayout(TargetMachine->createDataLayout()); std::string ObjectFileName = PTU.TheModule->getName().str() + ".o"; std::string BinaryFileName = PTU.TheModule->getName().str() + ".wasm"; @@ -146,4 +147,4 @@ llvm::Error WasmIncrementalExecutor::cleanUp() { WasmIncrementalExecutor::~WasmIncrementalExecutor() = default; -} // namespace clang \ No newline at end of file +} // namespace clang