mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Add a similar templated cast for getSubtarget off of the MachineFunction
to save typing a lot of static_casts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227621 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -176,6 +176,13 @@ public:
|
|||||||
const TargetSubtargetInfo &getSubtarget() const { return *STI; }
|
const TargetSubtargetInfo &getSubtarget() const { return *STI; }
|
||||||
void setSubtarget(const TargetSubtargetInfo *ST) { STI = ST; }
|
void setSubtarget(const TargetSubtargetInfo *ST) { STI = ST; }
|
||||||
|
|
||||||
|
/// getSubtarget - This method returns a pointer to the specified type of
|
||||||
|
/// TargetSubtargetInfo. In debug builds, it verifies that the object being
|
||||||
|
/// returned is of the correct type.
|
||||||
|
template<typename STC> const STC &getSubtarget() const {
|
||||||
|
return *static_cast<const STC *>(STI);
|
||||||
|
}
|
||||||
|
|
||||||
/// getRegInfo - Return information about the registers currently in use.
|
/// getRegInfo - Return information about the registers currently in use.
|
||||||
///
|
///
|
||||||
MachineRegisterInfo &getRegInfo() { return *RegInfo; }
|
MachineRegisterInfo &getRegInfo() { return *RegInfo; }
|
||||||
|
Reference in New Issue
Block a user