Ignore:
Timestamp:
Aug 27, 2018, 4:40:34 PM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
b7c89aa
Parents:
f9feab8 (diff), 305581d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into cleanup-dtors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/FixFunction.cc

    rf9feab8 r90152a4  
    3030                // can't delete function type because it may contain assertions, so transfer ownership to new object
    3131                ObjectDecl *pointer = new ObjectDecl( functionDecl->name, functionDecl->get_storageClasses(), functionDecl->linkage, nullptr, new PointerType( Type::Qualifiers(), functionDecl->type ), nullptr, functionDecl->attributes );
     32                pointer->location = functionDecl->location;
    3233                functionDecl->attributes.clear();
    3334                functionDecl->type = nullptr;
     
    3637        }
    3738
     39        // xxx - this passes on void[], e.g.
     40        //   void foo(void [10]);
     41        // does not cause an error
     42
    3843        Type * FixFunction::postmutate(ArrayType *arrayType) {
    3944                // need to recursively mutate the base type in order for multi-dimensional arrays to work.
    4045                PointerType *pointerType = new PointerType( arrayType->get_qualifiers(), arrayType->base, arrayType->dimension, arrayType->isVarLen, arrayType->isStatic );
     46                pointerType->location = arrayType->location;
    4147                arrayType->base = nullptr;
    4248                arrayType->dimension = nullptr;
     
    6268        void FixFunction::premutate(ZeroType *) { visit_children = false; }
    6369        void FixFunction::premutate(OneType *) { visit_children = false; }
     70
     71        bool fixFunction( DeclarationWithType *& dwt ) {
     72                PassVisitor<FixFunction> fixer;
     73                dwt = dwt->acceptMutator( fixer );
     74                return fixer.pass.isVoid;
     75        }
    6476} // namespace SymTab
    6577
Note: See TracChangeset for help on using the changeset viewer.