[clang] [clang-repl] Remove redundant shared flag while running clang-repl in browser (PR #118107)

2024-12-05 Thread Vassil Vassilev via cfe-commits

https://github.com/vgvassilev closed 
https://github.com/llvm/llvm-project/pull/118107
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-repl] Remove redundant shared flag while running clang-repl in browser (PR #118107)

2024-12-05 Thread Vassil Vassilev via cfe-commits

https://github.com/vgvassilev approved this pull request.

Lgtm!

https://github.com/llvm/llvm-project/pull/118107
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-repl] Remove redundant shared flag while running clang-repl in browser (PR #118107)

2024-12-05 Thread Anutosh Bhat via cfe-commits

anutosh491 wrote:

cc @vgvassilev 

Now that 19.1.5 is out. We can run clang-repl in the browser. And this flag is 
just adding redundancy and doesn't play a role. 
Small change. Should be ready !

https://github.com/llvm/llvm-project/pull/118107
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-repl] Remove redundant shared flag while running clang-repl in browser (PR #118107)

2024-11-29 Thread Anutosh Bhat via cfe-commits

https://github.com/anutosh491 edited 
https://github.com/llvm/llvm-project/pull/118107
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-repl] Remove redundant shared flag while running clang-repl in browser (PR #118107)

2024-11-29 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Anutosh Bhat (anutosh491)


Changes

While running clang-repl in the browser, we would be interested in this cc1 
command 

`
"" -cc1 -triple wasm32-unknown-emscripten -emit-obj -disable-free 
-clear-ast-before-backend -disable-llvm-verifier -discard-value-names 
-main-file-name "<<< inputs >>>" -mrelocation-model static 
-mframe-pointer=none -ffp-contract=on -fno-rounding-math -mconstructor-aliases 
-target-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/ -v 
-fcoverage-compilation-dir=/ -resource-dir /lib/clang/19 -internal-isystem 
/include/wasm32-emscripten/c++/v1 -internal-isystem /include/c++/v1 
-internal-isystem /lib/clang/19/include -internal-isystem 
/include/wasm32-emscripten -internal-isystem /include -std=c++17 
-fdeprecated-macro -ferror-limit 19 -fvisibility=default -fgnuc-version=4.2.1 
-fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fincremental-extensions 
-o "<<< inputs >>>.o" -x c++ "<<< inputs 
>>>"
`

As can be seen shared is anyway overwritten by static which is also what would 
be provided by default. Hence we can get rid of the shared flag here.

---
Full diff: https://github.com/llvm/llvm-project/pull/118107.diff


1 Files Affected:

- (modified) clang/lib/Interpreter/Interpreter.cpp (-1) 


``diff
diff --git a/clang/lib/Interpreter/Interpreter.cpp 
b/clang/lib/Interpreter/Interpreter.cpp
index 887b494ff98f19..fa4c1439c92612 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -200,7 +200,6 @@ IncrementalCompilerBuilder::CreateCpp() {
 #ifdef __EMSCRIPTEN__
   Argv.push_back("-target");
   Argv.push_back("wasm32-unknown-emscripten");
-  Argv.push_back("-shared");
   Argv.push_back("-fvisibility=default");
 #endif
   Argv.insert(Argv.end(), UserArgs.begin(), UserArgs.end());

``




https://github.com/llvm/llvm-project/pull/118107
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-repl] Remove redundant shared flag while running clang-repl in browser (PR #118107)

2024-11-29 Thread Anutosh Bhat via cfe-commits

https://github.com/anutosh491 created 
https://github.com/llvm/llvm-project/pull/118107

While running clang-repl in the browser, we would be interested in this cc1 
command 

`
"" -cc1 -triple wasm32-unknown-emscripten -emit-obj -disable-free 
-clear-ast-before-backend -disable-llvm-verifier -discard-value-names 
-main-file-name "<<< inputs >>>" -mrelocation-model static -mframe-pointer=none 
-ffp-contract=on -fno-rounding-math -mconstructor-aliases -target-cpu generic 
-debugger-tuning=gdb -fdebug-compilation-dir=/ -v -fcoverage-compilation-dir=/ 
-resource-dir /lib/clang/19 -internal-isystem /include/wasm32-emscripten/c++/v1 
-internal-isystem /include/c++/v1 -internal-isystem /lib/clang/19/include 
-internal-isystem /include/wasm32-emscripten -internal-isystem /include 
-std=c++17 -fdeprecated-macro -ferror-limit 19 -fvisibility=default 
-fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions 
-fincremental-extensions -o "<<< inputs >>>.o" -x c++ "<<< inputs >>>"
`

As can be seen shared is anyway overwritten by static which is also what would 
be provided by default. Hence we can get rid of the shared flag here.

>From 594b58c80cc0e3a27a3f4c6b92bd8e54a3118ad5 Mon Sep 17 00:00:00 2001
From: Anutosh Bhat 
Date: Fri, 29 Nov 2024 21:46:25 +0530
Subject: [PATCH] Remove redundant shared flag while running clang-repl in
 browser

---
 clang/lib/Interpreter/Interpreter.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/clang/lib/Interpreter/Interpreter.cpp 
b/clang/lib/Interpreter/Interpreter.cpp
index 887b494ff98f19..fa4c1439c92612 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -200,7 +200,6 @@ IncrementalCompilerBuilder::CreateCpp() {
 #ifdef __EMSCRIPTEN__
   Argv.push_back("-target");
   Argv.push_back("wasm32-unknown-emscripten");
-  Argv.push_back("-shared");
   Argv.push_back("-fvisibility=default");
 #endif
   Argv.insert(Argv.end(), UserArgs.begin(), UserArgs.end());

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits