diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-10-24 21:46:40 +0000 | 
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-10-24 21:46:40 +0000 | 
| commit | 22c40fa28551f0da487f399a2fe0d3d25edf3edc (patch) | |
| tree | bc2ce950d8e47e9a2ea3075d2d0ca232fb927385 /clang/lib/AST/ASTContext.cpp | |
| parent | c15758659826d042658c2f8acc52a95d68741bb4 (diff) | |
| download | bcm5719-llvm-22c40fa28551f0da487f399a2fe0d3d25edf3edc.tar.gz bcm5719-llvm-22c40fa28551f0da487f399a2fe0d3d25edf3edc.zip | |
-Add support for cv-qualifiers after function declarators.
-Add withConst/withVolatile/withRestrict methods to QualType class, that return the QualType plus the respective qualifier.
llvm-svn: 58120
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 8 | 
1 files changed, 5 insertions, 3 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); | 

