Use builtin __wasm_exception_handling__ macro. NFC#25285
Use builtin __wasm_exception_handling__ macro. NFC#25285sbc100 wants to merge 1 commit intoemscripten-core:mainfrom
Conversation
| # The code used to interpret exceptions during terminate | ||
| # is not compatible with emscripten exceptions. | ||
| cflags.append('-DLIBCXXABI_SILENT_TERMINATE') | ||
| elif self.eh_mode == Exceptions.WASM_LEGACY: |
There was a problem hiding this comment.
Is there some reason why this one is only comparing with WASM_LEGACY and not WASM?
There was a problem hiding this comment.
I think I forgot to update it. But anyway this is not necessary because we define it in the clang preprocessor: https://github.com/llvm/llvm-project/blob/82acc31fd4b26723b61dae76da120c0c649d0b97/clang/lib/Frontend/InitPreprocessor.cpp#L1034-L1035
So if we are to change the name we have to update this too.
There was a problem hiding this comment.
Why do you want to change it? To be consistent with __wasm__?
I don't mind changing it, but this is upstreamed, so we have to change it there as well. The instances are
aheejin@aheejin:~/llvm-git/clang$ grep __WASM_EXCEPTIONS__ * -R
lib/Frontend/InitPreprocessor.cpp: Builder.defineMacro("__WASM_EXCEPTIONS__");
test/CodeGenCXX/wasm-eh.cpp:// PREPROCESSOR: #define __WASM_EXCEPTIONS__ 1
aheejin@aheejin:~/llvm-git/libcxxabi$ grep __WASM_EXCEPTIONS__ * -R
src/cxa_personality.cpp:#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__WASM_EXCEPTIONS__)
src/cxa_personality.cpp:#else // __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS_
src/cxa_personality.cpp:#endif // __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS_
src/cxa_personality.cpp:#if defined(__USING_SJLJ_EXCEPTIONS__) || defined(__WASM_EXCEPTIONS__)
src/cxa_personality.cpp:#if defined(__USING_SJLJ_EXCEPTIONS__) || defined(__WASM_EXCEPTIONS__)
src/cxa_personality.cpp:#else // !__USING_SJLJ_EXCEPTIONS__ && !__WASM_EXCEPTIONS__
src/cxa_personality.cpp:#endif // !__USING_SJLJ_EXCEPTIONS__ && !__WASM_EXCEPTIONS__
src/cxa_personality.cpp:#if defined(__USING_SJLJ_EXCEPTIONS__) || defined(__WASM_EXCEPTIONS__)
src/cxa_personality.cpp:#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__WASM_EXCEPTIONS__)
src/cxa_personality.cpp:#else // __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS_
src/cxa_personality.cpp:#endif // __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS_
src/cxa_personality.cpp:#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__WASM_EXCEPTIONS__)
src/cxa_personality.cpp:#else // __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS_
src/cxa_personality.cpp:#endif // __USING_SJLJ_EXCEPTIONS__ || __WASM_EXCEPTIONS_
src/cxa_personality.cpp:#if !defined(__USING_SJLJ_EXCEPTIONS__) && !defined(__WASM_EXCEPTIONS__)
src/cxa_personality.cpp:#endif // !__USING_SJLJ_EXCEPTIONS__ && !__WASM_EXCEPTIONS__
src/cxa_personality.cpp:#ifdef __WASM_EXCEPTIONS__
src/cxa_personality.cpp:#ifdef __WASM_EXCEPTIONS__
aheejin@aheejin:~/llvm-git/libunwind$ grep __WASM_EXCEPTIONS__ * -R
src/Unwind-wasm.c:#ifdef __WASM_EXCEPTIONS__
src/Unwind-wasm.c:#endif // defined(__WASM_EXCEPTIONS__)Landing this before changing https://github.com/llvm/llvm-project/blob/82acc31fd4b26723b61dae76da120c0c649d0b97/clang/lib/Frontend/InitPreprocessor.cpp#L1034-L1035 will break the waterfall.
| # The code used to interpret exceptions during terminate | ||
| # is not compatible with emscripten exceptions. | ||
| cflags.append('-DLIBCXXABI_SILENT_TERMINATE') | ||
| elif self.eh_mode == Exceptions.WASM_LEGACY: |
There was a problem hiding this comment.
I think I forgot to update it. But anyway this is not necessary because we define it in the clang preprocessor: https://github.com/llvm/llvm-project/blob/82acc31fd4b26723b61dae76da120c0c649d0b97/clang/lib/Frontend/InitPreprocessor.cpp#L1034-L1035
So if we are to change the name we have to update this too.
|
Oh, if |
But don't you need the library part still? |
Which part are you referring to? |
|
That you changed |
On further consideration (and on finding out that
|
|
Not sure if I understand. You mean we should keep (Also llvm/llvm-project#159143 currently uses |
By "builtin" I mean "defined by the compiler", yes.
I mean could enable the wasm exception handling feature while not enabled wasm C++ EH, couldn't you? At least there seem to be two difference compiler-defined macros at play here.
Yes, because I want to define those tags whenever wasm exceptions handling is enabled, regardless of |
|
Do you mean we should keep two different preprocessors, We talked about merging |
I believe each wasm feature gets its own preprocess definition. This means that
If you think this is not needed then I suggest you propose removing one of them. Removing
|
No description provided.