File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -290,7 +290,11 @@ class Type {
290290
291291 // / If this is a vector type, return the element type, otherwise return
292292 // / 'this'.
293- Type *getScalarType () const LLVM_READONLY;
293+ Type *getScalarType () const {
294+ if (isVectorTy ())
295+ return getVectorElementType ();
296+ return const_cast <Type*>(this );
297+ }
294298
295299 // ===--------------------------------------------------------------------===//
296300 // Type Iteration support.
Original file line number Diff line number Diff line change @@ -41,12 +41,6 @@ Type *Type::getPrimitiveType(LLVMContext &C, TypeID IDNumber) {
4141 }
4242}
4343
44- Type *Type::getScalarType () const {
45- if (auto *VTy = dyn_cast<VectorType>(this ))
46- return VTy->getElementType ();
47- return const_cast <Type*>(this );
48- }
49-
5044bool Type::isIntegerTy (unsigned Bitwidth) const {
5145 return isIntegerTy () && cast<IntegerType>(this )->getBitWidth () == Bitwidth;
5246}
You can’t perform that action at this time.
0 commit comments