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 {
290
290
291
291
// / If this is a vector type, return the element type, otherwise return
292
292
// / 'this'.
293
- Type *getScalarType () const LLVM_READONLY;
293
+ Type *getScalarType () const {
294
+ if (isVectorTy ())
295
+ return getVectorElementType ();
296
+ return const_cast <Type*>(this );
297
+ }
294
298
295
299
// ===--------------------------------------------------------------------===//
296
300
// Type Iteration support.
Original file line number Diff line number Diff line change @@ -41,12 +41,6 @@ Type *Type::getPrimitiveType(LLVMContext &C, TypeID IDNumber) {
41
41
}
42
42
}
43
43
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
-
50
44
bool Type::isIntegerTy (unsigned Bitwidth) const {
51
45
return isIntegerTy () && cast<IntegerType>(this )->getBitWidth () == Bitwidth;
52
46
}
You can’t perform that action at this time.
0 commit comments