https://github.com/aytey created https://github.com/llvm/llvm-project/pull/86727
This PR fixes the following issue when working with `clang-repl`:
```
fatal error: error in backend: Inline asm not supported by this streamer
because we don't have an asm parser for this target
```
When working with the following input (named "unit.cpp"):
```cpp
__asm(".globl _ZSt21ios_base_library_initv");
int x;
```
and then in `clang-repl`:
```
#include "unit.cpp"
x = 10;
```
Signed-off-by: Andrew V. Teylu <[email protected]>
>From 784dd45324566775439b3c06674ab7d70b292d0b Mon Sep 17 00:00:00 2001
From: "Andrew V. Teylu" <[email protected]>
Date: Tue, 26 Mar 2024 20:10:24 +0000
Subject: [PATCH] [clang-repl] Add call to 'InitializeAllAsmParsers'
Signed-off-by: Andrew V. Teylu <[email protected]>
---
clang/tools/clang-repl/ClangRepl.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/clang/tools/clang-repl/ClangRepl.cpp
b/clang/tools/clang-repl/ClangRepl.cpp
index 5bad8145324d06..aecf61b97fc719 100644
--- a/clang/tools/clang-repl/ClangRepl.cpp
+++ b/clang/tools/clang-repl/ClangRepl.cpp
@@ -152,6 +152,7 @@ int main(int argc, const char **argv) {
llvm::InitializeAllTargets();
llvm::InitializeAllTargetMCs();
llvm::InitializeAllAsmPrinters();
+ llvm::InitializeAllAsmParsers();
if (OptHostSupportsJit) {
auto J = llvm::orc::LLJITBuilder().create();
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits