parent
923053a1d6
commit
8561721bce
|
@ -63,9 +63,11 @@ void GlobalValue::setAlignment(unsigned Align) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GlobalValue::isDeclaration() const {
|
bool GlobalValue::isDeclaration() const {
|
||||||
|
// Globals are definitions if they have an initializer.
|
||||||
if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(this))
|
if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(this))
|
||||||
return GV->getNumOperands() == 0;
|
return GV->getNumOperands() == 0;
|
||||||
|
|
||||||
|
// Functions are definitions if they have a body.
|
||||||
if (const Function *F = dyn_cast<Function>(this))
|
if (const Function *F = dyn_cast<Function>(this))
|
||||||
return F->empty();
|
return F->empty();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue