mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-15 15:48:38 +00:00
Since getSubtarget() always provides a const Subtarget, dont' require the user
to pass it in. Also, since it always returns a non-null pointer, make it return a reference instead for easier use. llvm-svn: 22686
This commit is contained in:
parent
79095d3416
commit
feb0442901
@ -105,11 +105,11 @@ public:
|
||||
/// getSubtarget - This method returns a pointer to the specified type of
|
||||
/// TargetSubtarget. In debug builds, it verifies that the object being
|
||||
/// returned is of the correct type.
|
||||
template<typename STC> STC *getSubtarget() const {
|
||||
template<typename STC> const STC &getSubtarget() const {
|
||||
const TargetSubtarget *TST = getSubtargetImpl();
|
||||
assert(getSubtargetImpl() && dynamic_cast<STC*>(TST) &&
|
||||
assert(TST && dynamic_cast<const STC*>(TST) &&
|
||||
"Not the right kind of subtarget!");
|
||||
return (STC*)TST;
|
||||
return *static_cast<const STC*>(TST);
|
||||
}
|
||||
|
||||
/// getRegisterInfo - If register information is available, return it. If
|
||||
|
Loading…
Reference in New Issue
Block a user