-Add support for cv-qualifiers after function declarators.
-Add withConst/withVolatile/withRestrict methods to QualType class, that return the QualType plus the respective qualifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58120 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index 5de4476..87b91ae 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -705,15 +705,18 @@
void FunctionTypeProto::Profile(llvm::FoldingSetNodeID &ID, QualType Result,
arg_type_iterator ArgTys,
- unsigned NumArgs, bool isVariadic) {
+ unsigned NumArgs, bool isVariadic,
+ unsigned TypeQuals) {
ID.AddPointer(Result.getAsOpaquePtr());
for (unsigned i = 0; i != NumArgs; ++i)
ID.AddPointer(ArgTys[i].getAsOpaquePtr());
ID.AddInteger(isVariadic);
+ ID.AddInteger(TypeQuals);
}
void FunctionTypeProto::Profile(llvm::FoldingSetNodeID &ID) {
- Profile(ID, getResultType(), arg_type_begin(), NumArgs, isVariadic());
+ Profile(ID, getResultType(), arg_type_begin(), NumArgs, isVariadic(),
+ getTypeQuals());
}
void ObjCQualifiedInterfaceType::Profile(llvm::FoldingSetNodeID &ID,