Skip to content

Commit c7181f9

Browse files
committed
Stop generating _d_eh_personality with -betterC
Closes #3479
1 parent a31ac78 commit c7181f9

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

gen/funcgenstate.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include "gen/funcgenstate.h"
1111

12+
#include "dmd/globals.h"
1213
#include "dmd/identifier.h"
1314
#include "gen/llvm.h"
1415
#include "gen/llvmhelpers.h"
@@ -118,6 +119,7 @@ llvm::CallSite FuncGenState::callOrInvoke(llvm::Value *callee,
118119
// Intrinsics don't support invoking and 'nounwind' functions don't need it.
119120
const bool doesNotThrow =
120121
isNothrow ||
122+
global.params.checkAction == CHECKACTION_C ||
121123
(calleeFn && (calleeFn->isIntrinsic() || calleeFn->doesNotThrow()));
122124

123125
// calls inside a funclet must be annotated with its value

tests/compilable/gh3479.d

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %ldc -betterC -run %s
2+
3+
extern (C) int main()
4+
{
5+
int a = 5;
6+
scope(exit) a = 6;
7+
create(0, 1, "2");
8+
return 0;
9+
}
10+
11+
void create(uint a, uint b, string c) {
12+
}

0 commit comments

Comments
 (0)