diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 7d2bd14ea945..1ddeaf1c46b2 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -1042,8 +1042,8 @@ public: CharUnits getTypeAlignInChars(QualType T) const; CharUnits getTypeAlignInChars(const Type *T) const; - std::pair getTypeInfoInChars(const Type *T); - std::pair getTypeInfoInChars(QualType T); + std::pair getTypeInfoInChars(const Type *T) const; + std::pair getTypeInfoInChars(QualType T) const; /// getPreferredTypeAlign - Return the "preferred" alignment of the specified /// type for the current target in bits. This can be different than the ABI diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 7da2f3484398..50c295f241f2 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -652,14 +652,14 @@ CharUnits ASTContext::getDeclAlign(const Decl *D, bool RefAsPointee) const { } std::pair -ASTContext::getTypeInfoInChars(const Type *T) { +ASTContext::getTypeInfoInChars(const Type *T) const { std::pair Info = getTypeInfo(T); return std::make_pair(toCharUnitsFromBits(Info.first), toCharUnitsFromBits(Info.second)); } std::pair -ASTContext::getTypeInfoInChars(QualType T) { +ASTContext::getTypeInfoInChars(QualType T) const { return getTypeInfoInChars(T.getTypePtr()); }