diff options
author | Ken Dyck <ken.dyck@onsemi.com> | 2009-12-18 15:24:05 +0000 |
---|---|---|
committer | Ken Dyck <ken.dyck@onsemi.com> | 2009-12-18 15:24:05 +0000 |
commit | cc906ef220c9be2644ad942457766d46a0b3651e (patch) | |
tree | 36a709d57d688e7826dc508071789213dae52bb8 | |
parent | 6f0e485a5cc120c5b30f5a5d11b2784de0c9c767 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91688 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/ASTContext.h | 14 | ||||
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index 3fc5aabde3..96861b5a2a 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -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. diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 14ee90d469..3db3eefc1e 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -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) |