mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Fix the problem with running cleanups in bugpoint: We were deleting arguments
of intrinsic functions, causing the verifier to fail. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9745 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b257e21905
commit
b6e0631a94
@ -99,6 +99,8 @@ namespace {
|
|||||||
struct DAH : public DAE {
|
struct DAH : public DAE {
|
||||||
virtual bool ShouldHackArguments() const { return true; }
|
virtual bool ShouldHackArguments() const { return true; }
|
||||||
};
|
};
|
||||||
|
RegisterPass<DAH> Y("deadarghaX0r",
|
||||||
|
"Dead Argument Hacking (bugpoint usage only)");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// createDeadArgEliminationPass - This pass removes arguments from functions
|
/// createDeadArgEliminationPass - This pass removes arguments from functions
|
||||||
@ -163,7 +165,8 @@ void DAE::SurveyFunction(Function &F) {
|
|||||||
bool FunctionIntrinsicallyLive = false;
|
bool FunctionIntrinsicallyLive = false;
|
||||||
Liveness RetValLiveness = F.getReturnType() == Type::VoidTy ? Live : Dead;
|
Liveness RetValLiveness = F.getReturnType() == Type::VoidTy ? Live : Dead;
|
||||||
|
|
||||||
if (!F.hasInternalLinkage() && !ShouldHackArguments())
|
if (!F.hasInternalLinkage() &&
|
||||||
|
(!ShouldHackArguments() || F.getIntrinsicID()))
|
||||||
FunctionIntrinsicallyLive = true;
|
FunctionIntrinsicallyLive = true;
|
||||||
else
|
else
|
||||||
for (Value::use_iterator I = F.use_begin(), E = F.use_end(); I != E; ++I) {
|
for (Value::use_iterator I = F.use_begin(), E = F.use_end(); I != E; ++I) {
|
||||||
|
Loading…
Reference in New Issue
Block a user