diff options
author | Chris Lattner <sabre@nondot.org> | 2007-04-28 05:42:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-04-28 05:42:38 +0000 |
commit | 4c27344bfd45b1864c9996698d82635596ce8be9 (patch) | |
tree | 7e215806129b4f850443496e4e6ef2f5d79d6f6e /include/llvm/Target/TargetLowering.h | |
parent | bb58b9c3c03dda9d03e92a9dd2a0d00dfb922331 (diff) | |
download | external_llvm-4c27344bfd45b1864c9996698d82635596ce8be9.zip external_llvm-4c27344bfd45b1864c9996698d82635596ce8be9.tar.gz external_llvm-4c27344bfd45b1864c9996698d82635596ce8be9.tar.bz2 |
add a default parameter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36529 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetLowering.h')
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index c862371..6880708 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -339,9 +339,11 @@ public: } /// getValueType - Return the MVT::ValueType corresponding to this LLVM type. - /// This is fixed by the LLVM operations except for the pointer size. - MVT::ValueType getValueType(const Type *Ty) const { - MVT::ValueType VT = MVT::getValueType(Ty); + /// This is fixed by the LLVM operations except for the pointer size. If + /// AllowUnknown is true, this will return MVT::Other for types with no MVT + /// counterpart (e.g. structs), otherwise it will assert. + MVT::ValueType getValueType(const Type *Ty, bool AllowUnknown = false) const { + MVT::ValueType VT = MVT::getValueType(Ty, AllowUnknown); return VT == MVT::iPTR ? PointerTy : VT; } |