anutosh491 wrote:

Some outputs 
```
// out of process

(base) anutosh491@vv-nuc:/build/anutosh491/llvm-project/build/bin$ ./clang-repl 
  --oop-executor=$PWD/llvm-jitlink-executor
clang version 22.0.0git (https://github.com/anutosh491/llvm-project.git 
81ad8fbc2bb09bae61ed59316468011e4a42cf47)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /build/anutosh491/llvm-project/build/bin
Build config: +unoptimized, +assertions
clang-repl> #include <iostream>
clang-repl> std::cout << "first";
firstclang-repl> std::cout << " second";
 secondclang-repl> std::cout << std::endl;

clang-repl> std::string myname;
clang-repl> std::cin >> myname;
ANUTOSH
clang-repl> std::cout << "Your name is " << myname;
Your name is ANUTOSHclang-repl> std::cout << "hello" << std::endl;
hello
clang-repl> #include <unistd.h>
clang-repl> for (int i = 0; i < 3; ++i) { std::cout << i << std::endl; 
sleep(1); }
0
1
2

// in process
anutosh491@vv-nuc:/build/anutosh491/llvm-project/build/bin$ ./clang-repl
clang-repl> #include <iostream>
clang-repl> std::cout << "first";
firstclang-repl> std::cout << " second";
 secondclang-repl> std::cout << std::endl;

clang-repl> std::string myname;
clang-repl> std::cin >> myname;
ANUTOSH
clang-repl> clang-repl> std::cout << "Your name is " << myname;
Your name is ANUTOSHclang-repl> std::cout << "hello" << std::endl;
hello
clang-repl> #include <unistd.h>
clang-repl> for (int i = 0; i < 3; ++i) { std::cout << i << std::endl; 
sleep(1); }
0
1
2
```

The only difference here is the `cin` for in-process
```
clang-repl> std::cin >> myname;
ANUTOSH
clang-repl> clang-repl> std::cout << "Your name is " << myname;
Your name is ANUTOSHclang-repl>
```
You can see 2 "clang-repl>"'s here. This is a separate in-process thing in 
itself (which needs to be looked into in the future)




https://github.com/llvm/llvm-project/pull/166368
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to