[cfe-commits] r91688 - in /cfe/trunk: include/clang/AST/ASTContext.h lib/CodeGen/CGDecl.cpp

Ken Dyck ken.dyck at onsemi.com
Fri Dec 18 07:24:05 PST 2009


Author: kjdyck
Date: Fri Dec 18 09:24:05 2009
New Revision: 91688

URL: http://llvm.org/viewvc/llvm-project?rev=91688&view=rev
Log:
Rename getByteSize() and getTypeSizeInBytes() in ASTContext to getCharWidth()
and getTypeSizeInChars() to reflect their basis in character type units, not
that of a possibly independent architecture-specific byte.

Modified:
    cfe/trunk/include/clang/AST/ASTContext.h
    cfe/trunk/lib/CodeGen/CGDecl.cpp

Modified: cfe/trunk/include/clang/AST/ASTContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=91688&r1=91687&r2=91688&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/ASTContext.h (original)
+++ cfe/trunk/include/clang/AST/ASTContext.h Fri Dec 18 09:24:05 2009
@@ -812,18 +812,18 @@
     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.

Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=91688&r1=91687&r2=91688&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Fri Dec 18 09:24:05 2009
@@ -471,7 +471,7 @@
       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)





More information about the cfe-commits mailing list