Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop generating _d_eh_personality with -betterC #3480

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gen/funcgenstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "gen/funcgenstate.h"

#include "dmd/globals.h"
#include "dmd/identifier.h"
#include "gen/llvm.h"
#include "gen/llvmhelpers.h"
Expand Down Expand Up @@ -118,6 +119,7 @@ llvm::CallSite FuncGenState::callOrInvoke(llvm::Value *callee,
// Intrinsics don't support invoking and 'nounwind' functions don't need it.
const bool doesNotThrow =
isNothrow ||
global.params.betterC ||
(calleeFn && (calleeFn->isIntrinsic() || calleeFn->doesNotThrow()));

// calls inside a funclet must be annotated with its value
Expand Down
12 changes: 12 additions & 0 deletions tests/compilable/gh3479.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// RUN: %ldc -betterC -run %s

extern (C) int main()
{
int a = 5;
scope(exit) a = 6;
create(0, 1, "2");
return 0;
}

void create(uint a, uint b, string c) {
}