[PATCH] D76892: [llvm][Type] Return fixed size for scalar types. [NFC]

Francesco Petrogalli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 27 15:27:23 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG4b3d94051ca2: [llvm][Type] Return fixed size for scalar types. [NFC] (authored by fpetrogalli).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76892/new/

https://reviews.llvm.org/D76892

Files:
  llvm/lib/IR/Type.cpp


Index: llvm/lib/IR/Type.cpp
===================================================================
--- llvm/lib/IR/Type.cpp
+++ llvm/lib/IR/Type.cpp
@@ -132,7 +132,8 @@
 }
 
 unsigned Type::getScalarSizeInBits() const {
-  return getScalarType()->getPrimitiveSizeInBits();
+  // It is safe to assume that the scalar types have a fixed size.
+  return getScalarType()->getPrimitiveSizeInBits().getFixedSize();
 }
 
 int Type::getFPMantissaWidth() const {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76892.253238.patch
Type: text/x-patch
Size: 451 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200327/14404ae8/attachment.bin>


More information about the llvm-commits mailing list