mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-07 19:36:06 +03:00
ARM: Use -arm-enable-ehabi(-descriptors).
D exception handling does not work at all yet, but with these flags it does for C++/Clang, at least in simple cases.
This commit is contained in:
parent
aba1b82539
commit
e4fee1116a
1 changed files with 14 additions and 0 deletions
|
@ -18,6 +18,7 @@
|
||||||
#include "llvm/ADT/Triple.h"
|
#include "llvm/ADT/Triple.h"
|
||||||
#include "llvm/MC/SubtargetFeature.h"
|
#include "llvm/MC/SubtargetFeature.h"
|
||||||
#include "llvm/Support/Host.h"
|
#include "llvm/Support/Host.h"
|
||||||
|
#include "llvm/Support/CommandLine.h"
|
||||||
#include "llvm/Support/TargetRegistry.h"
|
#include "llvm/Support/TargetRegistry.h"
|
||||||
#include "llvm/Support/TargetSelect.h"
|
#include "llvm/Support/TargetSelect.h"
|
||||||
#include "llvm/Target/TargetMachine.h"
|
#include "llvm/Target/TargetMachine.h"
|
||||||
|
@ -346,6 +347,19 @@ llvm::TargetMachine* createTargetMachine(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (triple.getArch() == llvm::Triple::arm)
|
||||||
|
{
|
||||||
|
// On ARM, we want to use EHABI exception handling, as we don't support
|
||||||
|
// SJLJ EH in druntime. Unfortunately, it is still in a partly
|
||||||
|
// experimental state, and the -arm-enable-ehabi-descriptors command
|
||||||
|
// line option is not exposed via an internal API at all.
|
||||||
|
const char *backendArgs[3] = {
|
||||||
|
"ldc2", // Fake name, irrelevant.
|
||||||
|
"-arm-enable-ehabi",
|
||||||
|
"-arm-enable-ehabi-descriptors"
|
||||||
|
};
|
||||||
|
llvm::cl::ParseCommandLineOptions(3, backendArgs);
|
||||||
|
}
|
||||||
|
|
||||||
llvm::TargetOptions targetOptions;
|
llvm::TargetOptions targetOptions;
|
||||||
targetOptions.NoFramePointerElim = genDebugInfo;
|
targetOptions.NoFramePointerElim = genDebugInfo;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue