Commit 25825d4
authored
[WebAssembly] Enable Wasm EH features only once (llvm#124042)
llvm#122466 had an unexpected side effect that,
`EnableFeaturesForWasmEHSjLj` and `BanIncompatibleOptionsForWasmEHSjLj`
can be called multiple times now, every time a Wasm EH flag
(`-fwasm-exceptions`, `-wasm-enable-eh`, `-wasm-enable-sjlj`, ..) was
checked and handled. This resulted in unnecessarily adding the same
feature-enabling arguments multiple times to the command line, for
example, `-target-feature +exception-handling` could be added as many as
three times, which didn't cause any errors but unnecessary. Also we ran
`BanIncompatibleOptionsForWasmEHSjLj` more than once, which was harmless
but unnecessary.
This guards these functions with a static variable so that we only run
them once.1 parent 42043c4 commit 25825d4
1 file changed
+8
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
350 | 353 | | |
351 | 354 | | |
352 | 355 | | |
| |||
370 | 373 | | |
371 | 374 | | |
372 | 375 | | |
| 376 | + | |
373 | 377 | | |
374 | 378 | | |
375 | 379 | | |
376 | 380 | | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
377 | 384 | | |
378 | 385 | | |
379 | 386 | | |
| |||
383 | 390 | | |
384 | 391 | | |
385 | 392 | | |
| 393 | + | |
386 | 394 | | |
387 | 395 | | |
388 | 396 | | |
| |||
0 commit comments