================ @@ -125,6 +137,25 @@ class TypeDescriptor { return 1 << (TypeInfo >> 1); } + const char *getBitIntBitCountPointer() const { + DCHECK(isBitIntTy()); + DCHECK(isSignedBitIntTy()); + // Scan Name for zero and return the next address + const char *p = getTypeName(); + while (*p != '\0') + ++p; + // Return the next address + return p + 1; + } + + unsigned getIntegerBitCount() const { + DCHECK(isIntegerTy()); + if (isSignedBitIntTy()) + return *reinterpret_cast<const u32 *>(getBitIntBitCountPointer()); ---------------- jakubjelinek wrote:
If it isn't performance critical, guess using internal_memcpy is an option as well. https://github.com/llvm/llvm-project/pull/96240 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits