[clang] [clang-repl] Fix generation of wasm binaries while running clang-repl in browser (PR #117978)

Vassil Vassilev via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 28 08:09:20 PST 2024


================
@@ -51,45 +76,50 @@ llvm::Error WasmIncrementalExecutor::addModule(PartialTranslationUnit &PTU) {
   llvm::TargetMachine *TargetMachine = Target->createTargetMachine(
       PTU.TheModule->getTargetTriple(), "", "", TO, llvm::Reloc::Model::PIC_);
   PTU.TheModule->setDataLayout(TargetMachine->createDataLayout());
-  std::string OutputFileName = PTU.TheModule->getName().str() + ".wasm";
+  std::string ObjectFileName =
+      PTU.TheModule->getName().str() + ".o"; // For the wasm object
+  std::string BinaryFileName =
+      PTU.TheModule->getName().str() + ".wasm"; // For the wasm binary
----------------
vgvassilev wrote:

```suggestion
  std::string ObjectFileName = PTU.TheModule->getName().str() + ".o";
  std::string BinaryFileName = PTU.TheModule->getName().str() + ".wasm";
```

https://github.com/llvm/llvm-project/pull/117978


More information about the cfe-commits mailing list