aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/TypeSerialization.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-10-26 16:43:14 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2008-10-26 16:43:14 +0000
commit7fb5e4888221cd36652d078c6b171ac55e7f406d (patch)
tree90d8bb74030debd15c7b4920f686c79fc0d6d30a /lib/AST/TypeSerialization.cpp
parent197fa58ab40e3fee2137715e96d9bb1c59340837 (diff)
Don't give a default argument to ASTContext::getFunctionType for the TypeQuals parameter, it causes subtle bugs where TypeQuals, while necessary, are omitted from the call.
-Remove the default argument. -Update all call sites of ASTContext::getFunctionType. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58187 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/TypeSerialization.cpp')
-rw-r--r--lib/AST/TypeSerialization.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/AST/TypeSerialization.cpp b/lib/AST/TypeSerialization.cpp
index ff784ccc27..b336722763 100644
--- a/lib/AST/TypeSerialization.cpp
+++ b/lib/AST/TypeSerialization.cpp
@@ -194,6 +194,7 @@ Type* FunctionTypeNoProto::CreateImpl(ASTContext& Context, Deserializer& D) {
void FunctionTypeProto::EmitImpl(Serializer& S) const {
S.Emit(getResultType());
S.EmitBool(isVariadic());
+ S.EmitInt(getTypeQuals());
S.EmitInt(getNumArgs());
for (arg_type_iterator I=arg_type_begin(), E=arg_type_end(); I!=E; ++I)
@@ -203,6 +204,7 @@ void FunctionTypeProto::EmitImpl(Serializer& S) const {
Type* FunctionTypeProto::CreateImpl(ASTContext& Context, Deserializer& D) {
QualType ResultType = QualType::ReadVal(D);
bool isVariadic = D.ReadBool();
+ unsigned TypeQuals = D.ReadInt();
unsigned NumArgs = D.ReadInt();
llvm::SmallVector<QualType,15> Args;
@@ -211,7 +213,7 @@ Type* FunctionTypeProto::CreateImpl(ASTContext& Context, Deserializer& D) {
Args.push_back(QualType::ReadVal(D));
return Context.getFunctionType(ResultType,&*Args.begin(),
- NumArgs,isVariadic).getTypePtr();
+ NumArgs,isVariadic,TypeQuals).getTypePtr();
}
//===----------------------------------------------------------------------===//