diff options
Diffstat (limited to 'clang/lib/AST/Mangle.cpp')
-rw-r--r-- | clang/lib/AST/Mangle.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/AST/Mangle.cpp b/clang/lib/AST/Mangle.cpp index 7ea569c63d9e..31cdad4c8fdd 100644 --- a/clang/lib/AST/Mangle.cpp +++ b/clang/lib/AST/Mangle.cpp @@ -223,6 +223,7 @@ void MangleContext::mangleName(GlobalDecl GD, raw_ostream &Out) { if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD)) if (!MD->isStatic()) ++ArgWords; + uint64_t DefaultPtrWidth = TI.getPointerWidth(LangAS::Default); for (const auto &AT : Proto->param_types()) { // If an argument type is incomplete there is no way to get its size to // correctly encode into the mangling scheme. @@ -230,11 +231,10 @@ void MangleContext::mangleName(GlobalDecl GD, raw_ostream &Out) { if (AT->isIncompleteType()) break; // Size should be aligned to pointer size. - ArgWords += - llvm::alignTo(ASTContext.getTypeSize(AT), TI.getPointerWidth(0)) / - TI.getPointerWidth(0); + ArgWords += llvm::alignTo(ASTContext.getTypeSize(AT), DefaultPtrWidth) / + DefaultPtrWidth; } - Out << ((TI.getPointerWidth(0) / 8) * ArgWords); + Out << ((DefaultPtrWidth / 8) * ArgWords); } void MangleContext::mangleMSGuidDecl(const MSGuidDecl *GD, raw_ostream &Out) { |