Skip to content

Commit 19cdc0a

Browse files
JOE1994nikic
andauthored
[llvm] Specialize 'NoCFIValue::getType()' (#72923)
Specialize `NoCFIValue::getType()` to give a more detailed type hint to clients. --------- Co-authored-by: Nikita Popov <[email protected]>
1 parent 0cfa109 commit 19cdc0a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/include/llvm/IR/Constants.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,11 @@ class NoCFIValue final : public Constant {
975975
return cast<GlobalValue>(Op<0>().get());
976976
}
977977

978+
/// NoCFIValue is always a pointer.
979+
PointerType *getType() const {
980+
return cast<PointerType>(Value::getType());
981+
}
982+
978983
/// Methods for support type inquiry through isa, cast, and dyn_cast:
979984
static bool classof(const Value *V) {
980985
return V->getValueID() == NoCFIValueVal;

0 commit comments

Comments
 (0)