diff options
author | Ken Dyck <kd@kendyck.com> | 2011-01-29 17:53:12 +0000 |
---|---|---|
committer | Ken Dyck <kd@kendyck.com> | 2011-01-29 17:53:12 +0000 |
commit | a45a70cf735cc0639d8ea3063db92645a782c959 (patch) | |
tree | ee8f2a28777be08c31c4230acecca44d5822c3fb /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 2a55951d08d130845d111c87bc0fc87c6ad18b8f (diff) | |
download | llvm-a45a70cf735cc0639d8ea3063db92645a782c959.zip llvm-a45a70cf735cc0639d8ea3063db92645a782c959.tar.gz llvm-a45a70cf735cc0639d8ea3063db92645a782c959.tar.bz2 |
Replace a literal '8' with getCharWidth().
llvm-svn: 124536
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index d2be432..80d0f10 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1717,15 +1717,16 @@ CodeGenModule::GetAddrOfConstantString(const StringLiteral *Literal) { /// GetStringForStringLiteral - Return the appropriate bytes for a /// string literal, properly padded to match the literal type. std::string CodeGenModule::GetStringForStringLiteral(const StringLiteral *E) { + const ASTContext &Context = getContext(); const ConstantArrayType *CAT = - getContext().getAsConstantArrayType(E->getType()); + Context.getAsConstantArrayType(E->getType()); assert(CAT && "String isn't pointer or array!"); // Resize the string to the right size. uint64_t RealLen = CAT->getSize().getZExtValue(); if (E->isWide()) - RealLen *= getContext().Target.getWCharWidth()/8; + RealLen *= Context.Target.getWCharWidth() / Context.getCharWidth(); std::string Str = E->getString().str(); Str.resize(RealLen, '\0'); |