diff options
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 8 | ||||
| -rw-r--r-- | clang/lib/AST/DeclCXX.cpp | 5 | ||||
| -rw-r--r-- | clang/lib/AST/Type.cpp | 7 | 
3 files changed, 12 insertions, 8 deletions
| diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 75c58880486..f8129969b7b 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -884,11 +884,13 @@ QualType ASTContext::getFunctionTypeNoProto(QualType ResultTy) {  /// getFunctionType - Return a normal function type with a typed argument  /// list.  isVariadic indicates whether the argument list includes '...'.  QualType ASTContext::getFunctionType(QualType ResultTy,const QualType *ArgArray, -                                     unsigned NumArgs, bool isVariadic) { +                                     unsigned NumArgs, bool isVariadic, +                                     unsigned TypeQuals) {    // Unique functions, to guarantee there is only one function of a particular    // structure.    llvm::FoldingSetNodeID ID; -  FunctionTypeProto::Profile(ID, ResultTy, ArgArray, NumArgs, isVariadic); +  FunctionTypeProto::Profile(ID, ResultTy, ArgArray, NumArgs, isVariadic, +                             TypeQuals);    void *InsertPos = 0;    if (FunctionTypeProto *FTP =  @@ -925,7 +927,7 @@ QualType ASTContext::getFunctionType(QualType ResultTy,const QualType *ArgArray,      (FunctionTypeProto*)malloc(sizeof(FunctionTypeProto) +                                  NumArgs*sizeof(QualType));    new (FTP) FunctionTypeProto(ResultTy, ArgArray, NumArgs, isVariadic, -                              Canonical); +                              TypeQuals, Canonical);    Types.push_back(FTP);    FunctionTypeProtos.InsertNode(FTP, InsertPos);    return QualType(FTP, 0); diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index 8baf4196bf6..a62ebad3651 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -64,9 +64,8 @@ QualType CXXMethodDecl::getThisType(ASTContext &C) const {    assert(isInstance() && "No 'this' for static methods!");    QualType ClassTy = C.getTagDeclType(const_cast<CXXRecordDecl*>(                                              cast<CXXRecordDecl>(getParent()))); -  QualType ThisTy = C.getPointerType(ClassTy); -  ThisTy.addConst(); -  return ThisTy; +  ClassTy = ClassTy.getWithAdditionalQualifiers(getTypeQualifiers()); +  return C.getPointerType(ClassTy).withConst();  }  CXXClassVarDecl *CXXClassVarDecl::Create(ASTContext &C, CXXRecordDecl *RD, diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index 5de44762c39..87b91ae2ea9 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -705,15 +705,18 @@ const char *BuiltinType::getName() const {  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, | 

