From f40a0a8b9f078888476a1066eef2868d0c425d1c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 28 Apr 2007 05:42:38 +0000 Subject: [PATCH] add a default parameter llvm-svn: 36529 --- llvm/include/llvm/Target/TargetLowering.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/Target/TargetLowering.h b/llvm/include/llvm/Target/TargetLowering.h index c862371c93a9..68807081305b 100644 --- a/llvm/include/llvm/Target/TargetLowering.h +++ b/llvm/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; }