mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-25 10:37:57 +00:00
@@ -0,0 +1,22 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#include "lld/Common/Driver.h"
|
||||
#include "lld/Common/CommonLinkerContext.h"
|
||||
#include "llvm/Support/CrashRecoveryContext.h"
|
||||
|
||||
extern "C" bool LLDELFLink(const char *argv[], size_t length)
|
||||
{
|
||||
bool canRunAgain;
|
||||
|
||||
{
|
||||
llvm::ArrayRef<const char *> args(argv, length);
|
||||
llvm::CrashRecoveryContext crc;
|
||||
if (!crc.RunSafely([&]()
|
||||
{ canRunAgain = lld::elf::link(args, llvm::outs(), llvm::errs(), false, false); }))
|
||||
return false;
|
||||
}
|
||||
|
||||
llvm::CrashRecoveryContext crc;
|
||||
return canRunAgain && crc.RunSafely([&]()
|
||||
{ lld::CommonLinkerContext::destroy(); });
|
||||
}
|
||||
Reference in New Issue
Block a user