mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
the verifier shouldn't modify the IR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85722 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -160,6 +160,21 @@ bool Constant::canTrap() const {
|
||||
}
|
||||
}
|
||||
|
||||
/// isConstantUsed - Return true if the constant has users other than constant
|
||||
/// exprs and other dangling things.
|
||||
bool Constant::isConstantUsed() const {
|
||||
for (use_const_iterator UI = use_begin(), E = use_end(); UI != E; ++UI) {
|
||||
const Constant *UC = dyn_cast<Constant>(*UI);
|
||||
if (UC == 0 || isa<GlobalValue>(UC))
|
||||
return true;
|
||||
|
||||
if (UC->isConstantUsed())
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// getRelocationInfo - This method classifies the entry according to
|
||||
/// whether or not it may generate a relocation entry. This must be
|
||||
|
Reference in New Issue
Block a user