Skip to content

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Sep 16, 2025

No description provided.

@@ -1640,8 +1640,6 @@ def get_cflags(self):
# 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:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some reason why this one is only comparing with WASM_LEGACY and not WASM?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sbc100 sbc100 requested a review from aheejin September 16, 2025 18:33
Copy link
Member

@aheejin aheejin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@@ -1640,8 +1640,6 @@ def get_cflags(self):
# 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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sbc100
Copy link
Collaborator Author

sbc100 commented Sep 17, 2025

Oh, if __WASM_EXCEPTIONS__ is defined by the pre-processor then maybe I'll instead just remove the setting of it here

@sbc100 sbc100 closed this Sep 17, 2025
@sbc100 sbc100 deleted the wasm_exception_handling_macro branch September 17, 2025 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants