- Timestamp:
- Jul 18, 2017, 4:39:08 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 870d1f0
- Parents:
- f19339e
- Location:
- src/SymTab
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Autogen.h
rf19339e r4fbdfae0 34 34 /// such as in determining array dimension type 35 35 extern Type * SizeType; 36 37 /// intrinsic dereference operator for unqualified types - set when *? function is seen in FindSpecialDeclarations. 38 /// Useful for creating dereference ApplicationExprs without a full resolver pass. 39 extern FunctionDecl * dereferenceOperator; 36 40 37 41 /// inserts into out a generated call expression to function fname with arguments dstParam and srcParam. Intended to be used with generated ?=?, ?{}, and ^?{} calls. -
src/SymTab/Validate.cc
rf19339e r4fbdfae0 237 237 }; 238 238 239 240 FunctionDecl * dereferenceOperator = nullptr; 241 struct FindSpecialDeclarations final { 242 void previsit( FunctionDecl * funcDecl ); 243 }; 244 239 245 void validate( std::list< Declaration * > &translationUnit, bool doDebug ) { 240 246 PassVisitor<EnumAndPointerDecay> epc; … … 243 249 PassVisitor<CompoundLiteral> compoundliteral; 244 250 PassVisitor<ValidateGenericParameters> genericParams; 251 PassVisitor<FindSpecialDeclarations> finder; 245 252 246 253 EliminateTypedef::eliminateTypedef( translationUnit ); … … 259 266 acceptAll( translationUnit, fpd ); 260 267 ArrayLength::computeLength( translationUnit ); 268 acceptAll( translationUnit, finder ); 261 269 } 262 270 … … 943 951 } 944 952 } 953 954 void FindSpecialDeclarations::previsit( FunctionDecl * funcDecl ) { 955 if ( ! dereferenceOperator ) { 956 if ( funcDecl->get_name() == "*?" && funcDecl->get_linkage() == LinkageSpec::Intrinsic ) { 957 FunctionType * ftype = funcDecl->get_functionType(); 958 if ( ftype->get_parameters().size() == 1 && ftype->get_parameters().front()->get_type()->get_qualifiers() == Type::Qualifiers() ) { 959 dereferenceOperator = funcDecl; 960 } 961 } 962 } 963 } 945 964 } // namespace SymTab 946 965
Note: See TracChangeset
for help on using the changeset viewer.