]> granicus.if.org Git - clang/commitdiff
Rename getByteSize() and getTypeSizeInBytes() in ASTContext to getCharWidth()
authorKen Dyck <ken.dyck@onsemi.com>
Fri, 18 Dec 2009 15:24:05 +0000 (15:24 +0000)
committerKen Dyck <ken.dyck@onsemi.com>
Fri, 18 Dec 2009 15:24:05 +0000 (15:24 +0000)
and getTypeSizeInChars() to reflect their basis in character type units, not
that of a possibly independent architecture-specific byte.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91688 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/ASTContext.h
lib/CodeGen/CGDecl.cpp

index 3fc5aabde32c75cffaab8a2c00c91333d0fce10d..96861b5a2a576a01beb6acc4c1319f626025cb7d 100644 (file)
@@ -812,18 +812,18 @@ public:
     return getTypeInfo(T).first;
   }
 
-  /// getByteWidth - Return the size of a byte, in bits
-  uint64_t getByteSize() {
+  /// getCharWidth - Return the size of the character type, in bits
+  uint64_t getCharWidth() {
     return getTypeSize(CharTy);
   }
   
-  /// getTypeSizeInBytes - Return the size of the specified type, in bytes.
+  /// getTypeSizeInChars - Return the size of the specified type, in characters.
   /// This method does not work on incomplete types.
-  uint64_t getTypeSizeInBytes(QualType T) {
-    return getTypeSize(T) / getByteSize();
+  uint64_t getTypeSizeInChars(QualType T) {
+    return getTypeSize(T) / getCharWidth();
   }
-  uint64_t getTypeSizeInBytes(const Type *T) {
-    return getTypeSize(T) / getByteSize();
+  uint64_t getTypeSizeInChars(const Type *T) {
+    return getTypeSize(T) / getCharWidth();
   }
 
   /// getTypeAlign - Return the ABI-specified alignment of a type, in bits.
index 14ee90d46936e06803b07bc00c753cda478e1abd..3db3eefc1e69ae544d41ce942bc7b0c4e7d32b76 100644 (file)
@@ -471,7 +471,7 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) {
       const llvm::Type *IntPtr =
         llvm::IntegerType::get(VMContext, LLVMPointerWidth);
       llvm::Value *SizeVal =
-        llvm::ConstantInt::get(IntPtr, getContext().getTypeSizeInBytes(Ty));
+        llvm::ConstantInt::get(IntPtr, getContext().getTypeSizeInChars(Ty));
 
       const llvm::Type *BP = llvm::Type::getInt8PtrTy(VMContext);
       if (Loc->getType() != BP)