8#include <rose_config.h>
10#ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
11 #include "roseAdapter.h"
12 #include "markLhsValues.h"
14 #include "Outliner.hh"
17 #include "transformationSupport.h"
20#include <boost/algorithm/string/trim.hpp>
23#include "AstConsistencyTests.h"
32#define BUILDER_MAKE_REDUNDANT_CALLS_TO_DETECT_TRANSFORAMTIONS 0
33#define BUILDER_MAKE_REDUNDANT_CALLS_TO_SYMBOL_TABLE_LOOKUP 0
40namespace EDG_ROSE_Translation
45#if defined(ROSE_BUILD_CXX_LANGUAGE_SUPPORT) && !defined(ROSE_USE_CLANG_FRONTEND)
47 extern bool suppress_detection_of_transformations;
50 bool suppress_detection_of_transformations;
62 static bool initialized =
false;
72template <
class actualFunction>
78template <
class actualFunction>
113 ASSERT_not_null(classType);
115 SgClassDeclaration* classDeclaration = isSgClassDeclaration(classType->get_declaration());
116 ASSERT_not_null(classDeclaration);
118 SgName className = classDeclaration->get_name();
121 printf (
"In SageBuilder::buildDefaultConstructor(): building default constructor for class = %s \n",className.str());
125 ASSERT_not_null(definingClassDeclaration);
127 ASSERT_not_null(classDefinition);
130 ASSERT_not_null(functionParameterList);
134 ASSERT_not_null(return_type);
137 bool buildTemplateInstantiation =
false;
140 unsigned int functionConstVolatileFlags = 0;
142 SgTemplateArgumentPtrList templateArgumentsList;
145 classDefinition, decoratorList, functionConstVolatileFlags, buildTemplateInstantiation, &templateArgumentsList);
146 ASSERT_not_null(first_nondefining_declaration);
148 first_nondefining_declaration->get_specialFunctionModifier().setConstructor();
149 ROSE_ASSERT(first_nondefining_declaration->get_specialFunctionModifier().isConstructor() ==
true);
159 classDefinition, decoratorList, buildTemplateInstantiation, functionConstVolatileFlags, first_nondefining_declaration, &templateArgumentsList);
160 ASSERT_not_null(memberFunctionDeclaration);
162 memberFunctionDeclaration->get_specialFunctionModifier().setConstructor();
163 ROSE_ASSERT(memberFunctionDeclaration->get_specialFunctionModifier().isConstructor() ==
true);
169 memberFunctionDeclaration->get_declarationModifier().get_accessModifier().setPublic();
171 ROSE_ASSERT (memberFunctionDeclaration->get_declarationModifier().get_accessModifier().isPublic() ==
true);
177 printf (
"In SageBuilder::buildDefaultConstructor(): building default constructor for class = %s \n",className.str());
178 printf (
" --- memberFunctionDeclaration = %p \n",memberFunctionDeclaration);
179 printf (
" --- first_nondefining_declaration = %p \n",first_nondefining_declaration);
181 printf (
" --- memberFunctionDeclaration->get_definingDeclaration() = %p \n",memberFunctionDeclaration->
get_definingDeclaration());
184 return memberFunctionDeclaration;
210 case e_sourcePositionError: s =
"e_sourcePositionError";
break;
220 printf (
"Error: default reached in SageBuilder::display(SourcePositionClassification & scp): scp = %d \n",scp);
234SgScopeStatement::find_symbol_by_type_of_function (
const SgName & name,
const SgType* func_type, SgTemplateParameterPtrList* templateParameterList, SgTemplateArgumentPtrList* templateArgumentsList)
261 switch((VariantT)T::static_variant)
263 case V_SgFunctionDeclaration:
264 case V_SgProcedureHeaderStatement:
265 case V_SgTemplateInstantiationFunctionDecl:
268 if ((VariantT)T::static_variant == V_SgTemplateInstantiationFunctionDecl)
270 ROSE_ASSERT(templateArgumentsList != NULL);
274 ROSE_ASSERT(templateArgumentsList == NULL);
278 func_symbol = lookup_nontemplate_function_symbol(name,func_type,templateArgumentsList);
280 ROSE_ASSERT(isSgTemplateFunctionSymbol(func_symbol) == NULL);
284 case V_SgMemberFunctionDeclaration:
285 case V_SgTemplateInstantiationMemberFunctionDecl:
289 if ((VariantT)T::static_variant == V_SgTemplateInstantiationMemberFunctionDecl)
291 ROSE_ASSERT(templateArgumentsList != NULL);
295 ROSE_ASSERT(templateArgumentsList == NULL);
297 func_symbol = lookup_nontemplate_member_function_symbol(name,func_type,templateArgumentsList);
301 case V_SgTemplateFunctionDeclaration:
305 ROSE_ASSERT(templateArgumentsList == NULL);
308 ROSE_ASSERT(templateParameterList != NULL);
318 func_symbol = lookup_template_function_symbol(name,func_type,templateParameterList);
323 case V_SgTemplateMemberFunctionDeclaration:
327 ROSE_ASSERT(templateArgumentsList == NULL);
330 ROSE_ASSERT(templateParameterList != NULL);
335 func_symbol = lookup_template_member_function_symbol(name,func_type,templateParameterList);
341 printf (
"In SgScopeStatement::find_symbol_by_type_of_function(): default reached --- variantT(T::static_variant) = %d \n",T::static_variant);
351template SgFunctionSymbol* SgScopeStatement::find_symbol_by_type_of_function<SgTemplateFunctionDeclaration>(
SgName const&,
SgType const*, SgTemplateParameterPtrList*, SgTemplateArgumentPtrList*);
352template SgFunctionSymbol* SgScopeStatement::find_symbol_by_type_of_function<SgTemplateInstantiationMemberFunctionDecl>(
SgName const&,
SgType const*, SgTemplateParameterPtrList*, SgTemplateArgumentPtrList*);
353template SgFunctionSymbol* SgScopeStatement::find_symbol_by_type_of_function<SgTemplateInstantiationFunctionDecl>(
SgName const&,
SgType const*, SgTemplateParameterPtrList*, SgTemplateArgumentPtrList*);
354template SgFunctionSymbol* SgScopeStatement::find_symbol_by_type_of_function<SgMemberFunctionDeclaration>(
SgName const&,
SgType const*, SgTemplateParameterPtrList*, SgTemplateArgumentPtrList*);
355template SgFunctionSymbol* SgScopeStatement::find_symbol_by_type_of_function<SgTemplateMemberFunctionDeclaration>(
SgName const&,
SgType const*, SgTemplateParameterPtrList*, SgTemplateArgumentPtrList*);
356template SgFunctionSymbol* SgScopeStatement::find_symbol_by_type_of_function<SgFunctionDeclaration>(
SgName const&,
SgType const*, SgTemplateParameterPtrList*, SgTemplateArgumentPtrList*);
361 ASSERT_not_null(stmt);
399 ASSERT_not_null(isSgGlobal(tempScope));
417 bool returnVar =
false;
418 std::list<SgScopeStatement*>::iterator i;
421 if (isSgSwitchStatement(*i) !=
nullptr)
446#define DEBUG_APPEND_TEMPLATE_ARGUMENT_LIST 0
448#if DEBUG_APPEND_TEMPLATE_ARGUMENT_LIST
449 printf (
"In SageBuilder::appendTemplateArgumentsToName(): CRITICAL FUNCTION TO BE REFACTORED (name = %s) \n",name.str());
454 ASSERT_not_null(info);
457 info->set_requiresGlobalNameQualification();
460 info->set_SkipClassDefinition();
461 info->set_SkipEnumDefinition();
462 info->set_use_generated_name_for_template_arguments(
true);
464 bool emptyArgumentList = templateArgumentsList.empty();
469 if (emptyArgumentList ==
false)
472 SgTemplateArgumentPtrList::const_iterator i = templateArgumentsList.begin();
473 bool need_separator =
false;
475 bool exit_after_name_is_generated =
false;
477 while (i != templateArgumentsList.end())
490#if DEBUG_APPEND_TEMPLATE_ARGUMENT_LIST
491 printf (
"In SageBuilder::appendTemplateArgumentsToName(): (top of loop) templateArgumentsList element *i = %p = %s returnName = %s \n",*i,(*i)->class_name().c_str(),returnName.str());
501 bool used_fully_qualified_name =
false;
503#define DEBUG_TEMPLATE_ARGUMENT_NAMES 0
508 ASSERT_not_null(templateArgument);
515 ASSERT_not_null(type);
517#if DEBUG_TEMPLATE_ARGUMENT_NAMES
518 printf (
"In SageBuilder::appendTemplateArgumentsToName(): case SgTemplateArgument::type_argument: BEFORE stripType: type = %p = %s \n",type,type->
class_name().c_str());
522 unsigned char bit_array = (SgType::STRIP_MODIFIER_TYPE | SgType::STRIP_REFERENCE_TYPE | SgType::STRIP_RVALUE_REFERENCE_TYPE | SgType::STRIP_POINTER_TYPE | SgType::STRIP_ARRAY_TYPE | SgType::STRIP_POINTER_MEMBER_TYPE);
525#if DEBUG_TEMPLATE_ARGUMENT_NAMES
526 printf (
"In SageBuilder::appendTemplateArgumentsToName(): case SgTemplateArgument::type_argument: AFTER stripType: type = %p = %s \n",type,type->
class_name().c_str());
529 if (isSgPointerType(templateArgument->
get_type()) !=
nullptr)
532#if DEBUG_TEMPLATE_ARGUMENT_NAMES
533 printf (
"Found a templateArgument->get_type() that is SgPointerType: name = %s \n",name.str());
538 if (namedType !=
nullptr)
542 ASSERT_not_null(declaration);
546 case V_SgTemplateInstantiationDecl:
547 case V_SgTemplateClassDeclaration:
548 case V_SgClassDeclaration:
551 string fully_qualified_name = classDeclaration->get_qualified_name();
552#if DEBUG_TEMPLATE_ARGUMENT_NAMES
553 printf (
"fully_qualified_name = %s \n",fully_qualified_name.c_str());
555 returnName += fully_qualified_name;
556 used_fully_qualified_name =
true;
560 case V_SgTemplateInstantiationTypedefDeclaration:
561 case V_SgTemplateTypedefDeclaration:
562 case V_SgTypedefDeclaration:
565 string fully_qualified_name = typedefDeclaration->get_qualified_name();
566#if DEBUG_TEMPLATE_ARGUMENT_NAMES
567 printf (
"fully_qualified_name = %s \n",fully_qualified_name.c_str());
569 returnName += fully_qualified_name;
570 used_fully_qualified_name =
true;
574 case V_SgEnumDeclaration:
577 string fully_qualified_name = enumDeclaration->get_qualified_name();
578#if DEBUG_TEMPLATE_ARGUMENT_NAMES
579 printf (
"fully_qualified_name = %s \n",fully_qualified_name.c_str());
581 returnName += fully_qualified_name;
582 used_fully_qualified_name =
true;
587 case V_SgNonrealDecl:
589 SgNonrealDecl* nonrealDeclaration = isSgNonrealDecl(declaration);
590 string fully_qualified_name = nonrealDeclaration->get_qualified_name();
591#if DEBUG_TEMPLATE_ARGUMENT_NAMES
592 printf (
"fully_qualified_name = %s \n",fully_qualified_name.c_str());
594 returnName += fully_qualified_name;
595 used_fully_qualified_name =
true;
602 printf (
"In SageBuilder::appendTemplateArgumentsToName(): default reached: get_type() != NULL: declaration = %s \n",declaration->
class_name().c_str());
609#if DEBUG_TEMPLATE_ARGUMENT_NAMES
610 printf (
"In SageBuilder::appendTemplateArgumentsToName(): not a SgNamedType: get_type() != NULL: type = %s \n",type->
class_name().c_str());
620 ROSE_ASSERT (templateArgument->
get_expression() != NULL || templateArgument->get_initializedName() != NULL);
621 ROSE_ASSERT (templateArgument->
get_expression() == NULL || templateArgument->get_initializedName() == NULL);
625 ASSERT_not_null(expression);
629 SgVarRefExp* varRefExp = isSgVarRefExp(expression);
630 if (varRefExp != NULL)
634 ROSE_ASSERT(variableSymbol != NULL);
636 ROSE_ASSERT(initializedName != NULL);
638#if DEBUG_TEMPLATE_ARGUMENT_NAMES
639 printf (
"fully_qualified_name = %s \n",fully_qualified_name.c_str());
641 returnName += fully_qualified_name;
642 used_fully_qualified_name =
true;
647#if DEBUG_TEMPLATE_ARGUMENT_NAMES
648 printf (
"In SageBuilder::appendTemplateArgumentsToName(): Case of template argument varRefExp == NULL: expression = %p = %s \n",
652 printf (
"In SageBuilder::appendTemplateArgumentsToName(): Case of template argument varRefExp == NULL is not yet supported! \n");
663 ROSE_ASSERT(initializedName != NULL);
664 printf (
"initializedName = %p = %s \n",initializedName,initializedName->get_name().str());
666 printf (
"In SageBuilder::appendTemplateArgumentsToName(): Case of template argument initializedName != NULL: Unclear what do do in this case \n");
676 ASSERT_not_null(decl);
677#if DEBUG_TEMPLATE_ARGUMENT_NAMES
678 printf (
"In SageBuilder::appendTemplateArgumentsToName(): case SgTemplateArgument::template_template_argument: decl = %p = %s \n",decl,decl->
class_name().c_str());
680 exit_after_name_is_generated =
true;
682 printf (
"Exiting as a test! \n");
686 ROSE_ASSERT(tpl_decl == NULL);
693#if DEBUG_TEMPLATE_ARGUMENT_NAMES
694 printf(
"WARNING: start_of_pack_expansion_argument in evaluateNameQualificationForTemplateArgumentList (can happen from some debug output)\n");
702 printf(
"Error argument_undefined in evaluateNameQualificationForTemplateArgumentList \n");
710 printf(
"Error default reached in evaluateNameQualificationForTemplateArgumentList \n");
719 if (used_fully_qualified_name ==
false)
724#if DEBUG_APPEND_TEMPLATE_ARGUMENT_LIST
725 printf (
"In SageBuilder::appendTemplateArgumentsToName(): (after appending template name) *i = %p returnName = %s \n",*i,returnName.str());
727 need_separator =
true;
730#if DEBUG_APPEND_TEMPLATE_ARGUMENT_LIST
731 printf (
"In SageBuilder::appendTemplateArgumentsToName(): (bottom of loop) returnName = %s \n",returnName.str());
735 if (emptyArgumentList ==
false)
738#if DEBUG_APPEND_TEMPLATE_ARGUMENT_LIST || DEBUG_TEMPLATE_ARGUMENT_NAMES
739 printf (
"Leaving SageBuilder::appendTemplateArgumentsToName(): returnName = %s \n",returnName.str());
745 if (exit_after_name_is_generated ==
true)
747 printf (
"Exiting as a test! \n");
765 ROSE_ASSERT(templateArgument != NULL);
768 ROSE_ASSERT(info != NULL);
773 info->set_SkipClassDefinition();
774 info->set_SkipEnumDefinition();
775 info->set_use_generated_name_for_template_arguments(
true);
786SgTemplateArgumentPtrList*
792 ROSE_ASSERT(decl != NULL);
794 SgTemplateArgumentPtrList* templateArgumentsList = NULL;
799 case V_SgNamespaceAliasDeclarationStatement:
803 case V_SgNamespaceDeclarationStatement:
804 case V_SgEnumDeclaration:
805 case V_SgVariableDeclaration:
806 case V_SgTypedefDeclaration:
808 templateArgumentsList = NULL;
815 case V_SgProcedureHeaderStatement:
816 case V_SgJovialTableStatement:
817 case V_SgJavaPackageDeclaration:
818 case V_SgFunctionDeclaration:
819 case V_SgMemberFunctionDeclaration:
820 case V_SgClassDeclaration:
822 templateArgumentsList = NULL;
826 case V_SgTemplateInstantiationDecl:
832 case V_SgTemplateClassDeclaration:
834 templateArgumentsList = &(isSgTemplateClassDeclaration(decl)->get_templateSpecializationArguments());
838 case V_SgTemplateInstantiationFunctionDecl:
844 case V_SgTemplateFunctionDeclaration:
846 templateArgumentsList = &(isSgTemplateFunctionDeclaration(decl)->get_templateSpecializationArguments());
850 case V_SgTemplateInstantiationMemberFunctionDecl:
852 templateArgumentsList = &(isSgTemplateInstantiationMemberFunctionDecl(decl)->
get_templateArguments());
856 case V_SgTemplateMemberFunctionDeclaration:
858 templateArgumentsList = &(isSgTemplateMemberFunctionDeclaration(decl)->get_templateSpecializationArguments());
862 case V_SgTemplateVariableDeclaration:
864 templateArgumentsList = &(isSgTemplateVariableDeclaration(decl)->get_templateSpecializationArguments());
869 case V_SgTemplateTypedefDeclaration:
871 templateArgumentsList = &(isSgTemplateTypedefDeclaration(decl)->get_templateSpecializationArguments());
876 case V_SgTemplateInstantiationTypedefDeclaration:
878 templateArgumentsList = &(isSgTemplateInstantiationTypedefDeclaration(decl)->get_templateArguments());
882 case V_SgTemplateDeclaration:
884 templateArgumentsList = NULL;
888 case V_SgNonrealDecl:
890 templateArgumentsList = &(isSgNonrealDecl(decl)->get_tpl_args());
896 printf (
"getTemplateArgumentList(): Default reached in switch: decl = %p = %s \n",decl,decl->
class_name().c_str());
901 return templateArgumentsList;
906SgTemplateParameterPtrList*
912 ROSE_ASSERT(decl != NULL);
914 SgTemplateParameterPtrList* templateParameterList = NULL;
919 case V_SgNamespaceAliasDeclarationStatement:
923 case V_SgNamespaceDeclarationStatement:
924 case V_SgEnumDeclaration:
925 case V_SgVariableDeclaration:
926 case V_SgTypedefDeclaration:
928 templateParameterList = NULL;
935 case V_SgProcedureHeaderStatement:
936 case V_SgJovialTableStatement:
937 case V_SgJavaPackageDeclaration:
938 case V_SgFunctionDeclaration:
939 case V_SgMemberFunctionDeclaration:
940 case V_SgClassDeclaration:
942 templateParameterList = NULL;
947 case V_SgTemplateInstantiationTypedefDeclaration:
951 case V_SgTemplateInstantiationDecl:
952 case V_SgTemplateInstantiationFunctionDecl:
953 case V_SgTemplateInstantiationMemberFunctionDecl:
955 templateParameterList = NULL;
959 case V_SgTemplateClassDeclaration:
961 templateParameterList = &(isSgTemplateClassDeclaration(decl)->get_templateParameters());
965 case V_SgTemplateFunctionDeclaration:
967 templateParameterList = &(isSgTemplateFunctionDeclaration(decl)->get_templateParameters());
971 case V_SgTemplateMemberFunctionDeclaration:
973 templateParameterList = &(isSgTemplateMemberFunctionDeclaration(decl)->get_templateParameters());
977 case V_SgTemplateVariableDeclaration:
979 templateParameterList = &(isSgTemplateVariableDeclaration(decl)->get_templateParameters());
984 case V_SgTemplateTypedefDeclaration:
986 templateParameterList = &(isSgTemplateTypedefDeclaration(decl)->get_templateParameters());
990 case V_SgNonrealDecl:
992 templateParameterList = &(isSgNonrealDecl(decl)->get_tpl_params());
996 case V_SgTemplateDeclaration:
998 templateParameterList = &(isSgTemplateDeclaration(decl)->get_templateParameters());
1004 printf (
"getTemplateParameterList(): Default reached in switch: decl = %p = %s \n",decl,decl->
class_name().c_str());
1009 return templateParameterList;
1019 ROSE_ASSERT(decl != NULL);
1023 if (templateArgumentsList != NULL)
1026 ROSE_ASSERT(first_decl != NULL);
1028 SgTemplateArgumentPtrList::iterator i = templateArgumentsList->begin();
1029 while (i != templateArgumentsList->end())
1044 (*i)->set_parent(first_decl);
1049 if (declaration != NULL)
1051#ifdef ROSE_DEBUG_NEW_EDG_ROSE_CONNECTION
1052 printf (
"In setTemplateArgumentParents(): Template argument already set to declaration = %p = %s \n",declaration,declaration->
class_name().c_str());
1057#ifdef ROSE_DEBUG_NEW_EDG_ROSE_CONNECTION
1058 printf (
"Error: In setTemplateArgumentParents(): I think it is an error for the template argument parent to be set to %p = %s \n",parent,parent->
class_name().c_str());
1076 ROSE_ASSERT(decl != NULL);
1080 if (templateParameterList != NULL)
1083 ROSE_ASSERT(first_decl != NULL);
1085 SgTemplateParameterPtrList::iterator i = templateParameterList->begin();
1086 while (i != templateParameterList->end())
1100 (*i)->set_parent(first_decl);
1117 ROSE_ASSERT(decl != NULL);
1121 if (templateArgumentsList != NULL)
1123 SgTemplateArgumentPtrList::iterator i = templateArgumentsList->begin();
1124 while (i != templateArgumentsList->end())
1129 printf (
"Error: In testTemplateArgumentParents(): decl = %p = %s has template argument = %p with null parent \n",decl,decl->
class_name().c_str(),*i);
1131 ROSE_ASSERT(parent != NULL);
1150 ROSE_ASSERT(decl != NULL);
1154 if (templateParameterList != NULL)
1156 SgTemplateParameterPtrList::iterator i = templateParameterList->begin();
1157 while (i != templateParameterList->end())
1162 printf (
"Error: In testTemplateParameterParents(): decl = %p = %s has template argument = %p with null parent \n",decl,decl->
class_name().c_str(),*i);
1164 ROSE_ASSERT(parent != NULL);
1172 printf (
"Error: In testTemplateParameterParents(): decl = %p = %s has template argument = %p with parent = %p = %s \n",decl,decl->
class_name().c_str(),*i,parent,parent->
class_name().c_str());
1192 ROSE_ASSERT(templateArgumentsList_input != NULL);
1194 ROSE_ASSERT(decl->
variantT() == V_SgTemplateInstantiationDecl ||
1195 decl->
variantT() == V_SgTemplateInstantiationFunctionDecl ||
1196 decl->
variantT() == V_SgTemplateInstantiationMemberFunctionDecl ||
1197 decl->
variantT() == V_SgTemplateInstantiationTypedefDeclaration);
1201 if (templateArgumentsList_from_declaration != NULL)
1203 *templateArgumentsList_from_declaration = *templateArgumentsList_input;
1218 ROSE_ASSERT(templateSpecializationArgumentsList_input != NULL);
1220 ROSE_ASSERT(decl->
variantT() == V_SgTemplateClassDeclaration || decl->
variantT() == V_SgTemplateFunctionDeclaration ||
1221 decl->
variantT() == V_SgTemplateMemberFunctionDeclaration || decl->
variantT() == V_SgTemplateVariableDeclaration );
1223 SgTemplateArgumentPtrList* templateSpecializationArgumentsList_from_declaration =
getTemplateArgumentList(decl);
1225 if (templateSpecializationArgumentsList_from_declaration != NULL)
1227 *templateSpecializationArgumentsList_from_declaration = *templateSpecializationArgumentsList_input;
1241 ROSE_ASSERT(templateParameterList_input != NULL);
1243 ROSE_ASSERT(decl->
variantT() == V_SgTemplateClassDeclaration || decl->
variantT() == V_SgTemplateFunctionDeclaration ||
1244 decl->
variantT() == V_SgTemplateMemberFunctionDeclaration || decl->
variantT() == V_SgTemplateVariableDeclaration );
1248 if (templateParameterList_from_declaration != NULL)
1250 *templateParameterList_from_declaration = *templateParameterList_input;
1266 ASSERT_not_null(type);
1269 ASSERT_not_null(initializedName);
1272 return initializedName;
1287 string var_name(name);
1294 ASSERT_not_null(type);
1297 ASSERT_not_null(initializedName);
1298 ASSERT_require(init ==
nullptr || init->get_parent() == initializedName);
1302 return initializedName;
1315 ROSE_ASSERT(name.is_null() ==
false);
1316 ROSE_ASSERT(type != NULL);
1319 ROSE_ASSERT(varDecl);
1332 bool isFortranParameter =
false;
1340 if (v_symbol != NULL)
1344 ROSE_ASSERT (default_initName != NULL);
1346 ROSE_ASSERT (new_initName != NULL);
1347 ROSE_ASSERT (default_initName != new_initName);
1350 std::replace (n_list.begin(), n_list.end(),default_initName, new_initName );
1351 ROSE_ASSERT (varDecl->get_decl_item (name)==new_initName);
1355 ROSE_ASSERT (old_parent != NULL);
1356 ROSE_ASSERT (isSgFunctionParameterList(old_parent) != NULL);
1364 ROSE_ASSERT (var_def != NULL);
1367 new_initName->set_declptr(var_def);
1369 delete (default_initName);
1375 isFortranParameter =
true;
1379 if (! isFortranParameter)
1385 ROSE_ASSERT(initName != NULL);
1386 ROSE_ASSERT((initName->get_declptr())!=NULL);
1404 unsetNodesMarkedAsModified(varDecl);
1420#define DEBUG_BUILD_VARIABLE_DECLARATION 0
1422#if DEBUG_BUILD_VARIABLE_DECLARATION
1423 printf (
"In SageBuilder::buildVariableDeclaration_nfi(): name = %s scope = %p varInit = %p \n",name.str(),scope,varInit);
1426 printf (
" --- scope = %p = %s \n",scope,scope->
class_name().c_str());
1432#if DEBUG_BUILD_VARIABLE_DECLARATION
1433 printf (
"Scope determined from the SageBuilder::topScopeStack() \n");
1438 ROSE_ASSERT (scope != NULL);
1439 ROSE_ASSERT(type != NULL);
1444#if DEBUG_BUILD_VARIABLE_DECLARATION
1445 printf (
"In SageBuilder::buildVariableDeclaration_nfi(): variableSymbol = %p \n",variableSymbol);
1450 if (variableSymbol == NULL)
1453#if DEBUG_BUILD_VARIABLE_DECLARATION
1455 ROSE_ASSERT(tmp_initializedName != NULL);
1456 printf (
"In SageBuilder::buildVariableDeclaration_nfi(): variableSymbol == NULL: varDecl = %p: initializedName = %p = %s \n",varDecl,tmp_initializedName,tmp_initializedName->get_name().str());
1457 printf (
" --- tmp_initializedName->get_initptr() = %p \n",tmp_initializedName->get_initptr());
1460 if (builtFromUseOnly ==
true)
1462#if DEBUG_BUILD_VARIABLE_DECLARATION
1463 printf (
"In buildVariableDeclaration_nfi(): this is the first reference to this variable: building a new SgVariableDeclaration: varDecl = %p name = %s \n",varDecl,name.str());
1465 varDecl->set_builtFromUseOnly(
true);
1471 ROSE_ASSERT(initializedName != NULL);
1475#if DEBUG_BUILD_VARIABLE_DECLARATION
1476 printf (
"In SageBuilder::buildVariableDeclaration_nfi(): initializedName->get_parent() = %p \n",initializedName->
get_parent());
1479 printf (
"In SageBuilder::buildVariableDeclaration_nfi(): initializedName->get_parent() = %p = %s \n",initializedName->
get_parent(),initializedName->
get_parent()->
class_name().c_str());
1481 printf (
"In SageBuilder::buildVariableDeclaration_nfi(): associatedVariableDeclaration = %p \n",associatedVariableDeclaration);
1483#if DEBUG_BUILD_VARIABLE_DECLARATION
1486 if (associatedVariableDeclaration != NULL && associatedVariableDeclaration->
get_parent() != NULL)
1488 printf (
"In SageBuilder::buildVariableDeclaration_nfi(): associatedVariableDeclaration->get_parent() = %p = %s \n",
1493#if DEBUG_BUILD_VARIABLE_DECLARATION
1494 printf (
"associatedVariableDeclaration = %p \n",associatedVariableDeclaration);
1495 if (associatedVariableDeclaration != NULL)
1497 printf (
"associatedVariableDeclaration->get_builtFromUseOnly() = %s \n",associatedVariableDeclaration->get_builtFromUseOnly() ?
"true" :
"false");
1502 bool reuseTheAssociatedVariableDeclaration = ((associatedVariableDeclaration != NULL) && (associatedVariableDeclaration->get_builtFromUseOnly() ==
true));
1503 if (reuseTheAssociatedVariableDeclaration ==
true)
1509 ROSE_ASSERT(associatedVariableDeclaration != NULL);
1512 varDecl = associatedVariableDeclaration;
1515 varDecl->set_builtFromUseOnly(
false);
1526#if DEBUG_BUILD_VARIABLE_DECLARATION
1527 if (
variable->get_initptr() != NULL)
1529 printf (
"Found initializer associated with variable declaration being reused: variable = %p name = %s \n",
variable,
variable->get_name().str());
1538 ROSE_ASSERT(reuseTheAssociatedVariableDeclaration ==
false);
1544 if (associatedVariableDeclaration == NULL)
1546 ROSE_ASSERT(initializedName->
get_parent() != NULL);
1548 if (scopeStatement != NULL)
1550#if DEBUG_BUILD_VARIABLE_DECLARATION
1551 printf (
"scopeStatement = %p = %s \n",scopeStatement,scopeStatement->
class_name().c_str());
1556#if DEBUG_BUILD_VARIABLE_DECLARATION
1568#if DEBUG_BUILD_VARIABLE_DECLARATION
1569 printf (
"In SageBuilder::buildVariableDeclaration_nfi(): initializedName->get_scope() = %p = %s \n",initializedName->get_scope(),initializedName->get_scope()->
class_name().c_str());
1572 if (scopeStatement != NULL)
1574 additional_variable = initializedName;
1578 if (additional_variable->get_initptr() != NULL)
1580#if DEBUG_BUILD_VARIABLE_DECLARATION
1581 printf (
"In SageBuilder::buildVariableDeclaration_nfi(): borrowed SgInitializedName is alread initialized \n");
1582 printf (
" --- additional_variable->get_initptr() = %p \n",additional_variable->get_initptr());
1583 printf (
" --- varInit = %p \n",varInit);
1590 additional_variable->set_initptr(varInit);
1593#if DEBUG_BUILD_VARIABLE_DECLARATION || 0
1594 printf (
" --- additional_variable->get_scope() = %p = %s \n",additional_variable->get_scope(),additional_variable->get_scope()->
class_name().c_str());
1595 printf (
" --- Reusing the SgInitializedName (not associated with a previous SgVariableDeclaration where the parent is a SgScopeStatement) \n");
1600#if DEBUG_BUILD_VARIABLE_DECLARATION
1601 printf (
" --- Building a new SgInitializedName \n");
1606#if DEBUG_BUILD_VARIABLE_DECLARATION
1607 ROSE_ASSERT(initializedName->get_scope() != NULL);
1611 if (additional_variable != initializedName)
1613 additional_variable->set_prev_decl_item(initializedName);
1618#if DEBUG_BUILD_VARIABLE_DECLARATION
1619 ROSE_ASSERT(initializedName->
get_parent() != NULL);
1621 ROSE_ASSERT(additional_variable->
get_parent() != NULL);
1622 printf (
"additional_variable->get_parent() = %p = %s \n",additional_variable->
get_parent(),additional_variable->
get_parent()->
class_name().c_str());
1627 ASSERT_not_null(initializedName->get_scope());
1630 if (additional_variable != initializedName)
1632 additional_variable->set_scope(initializedName->get_scope());
1636#if DEBUG_BUILD_VARIABLE_DECLARATION
1637 printf (
"In SageBuilder::buildVariableDeclaration_nfi(): After sharing the exisitng SgInitializedName: initializedName = %p = %s \n",initializedName,initializedName->get_name().str());
1638 printf (
" --- initializedName->get_initptr() = %p \n",initializedName->get_initptr());
1639 printf (
" --- additional_variable->get_initptr() = %p \n",additional_variable->get_initptr());
1649 ASSERT_not_null(varDecl);
1651 varDecl->get_declarationModifier().get_storageModifier().set_modifier(sm);
1672 ASSERT_not_null(initName);
1673 ASSERT_not_null(initName->get_declptr());
1675 if (initName->get_scope())
1678#if DEBUG_BUILD_VARIABLE_DECLARATION
1679 printf (
"WARNING: Note in buildVariableDeclaration_nfi(): initName->get_scope() == NULL \n");
1687 SgVariableDefinition* variableDefinition_original = isSgVariableDefinition(initName->get_declptr());
1688 ASSERT_not_null(variableDefinition_original);
1703 unsetNodesMarkedAsModified(varDecl);
1705 ASSERT_not_null(varDecl);
1707#if DEBUG_BUILD_VARIABLE_DECLARATION
1708 printf (
"Leaving buildVariableDeclaration_nfi(): varDecl = %p varDecl->get_parent() = %p \n",varDecl,varDecl->
get_parent());
1720 ROSE_ASSERT (decl!=NULL);
1721 ROSE_ASSERT (init_name !=NULL);
1725 if (!isSgFunctionType(init_name->get_type()))
1731 ROSE_ASSERT (copyOfFileInfo != NULL);
1735 ROSE_ASSERT (defn_stmt != NULL);
1753 ROSE_ASSERT(defn_stmt != NULL);
1776 ROSE_ASSERT (scope != NULL);
1777 ROSE_ASSERT(type != NULL);
1780 ROSE_ASSERT(varDecl);
1796 ROSE_ASSERT(initName);
1797 ROSE_ASSERT((initName->get_declptr())!=NULL);
1802 SgVariableDefinition* variableDefinition_original = isSgVariableDefinition(initName->get_declptr());
1803 ROSE_ASSERT(variableDefinition_original != NULL);
1840 ROSE_ASSERT (base_type != NULL);
1848 ASSERT_not_null(scope);
1854 ASSERT_not_null(stripedBaseType);
1856 SgNamedType* namedType = isSgNamedType(stripedBaseType);
1865 base_decl = namedType->get_declaration();
1868 ROSE_ASSERT(base_decl != NULL);
1875#ifndef ROSE_USE_CLANG_FRONTEND
1888 if (declaration && !isSgAdaDiscriminatedTypeDecl(declaration))
1890 mprintf (
"Found a valid declaration = %p = %s \n",declaration,declaration->
class_name().c_str());
1896 ROSE_ASSERT(parent_scope != NULL);
1903 ROSE_ASSERT(type_decl != NULL);
1923 SgClassDeclaration* def_class = isSgClassDeclaration(base_class->get_definingDeclaration());
1924 SgClassDeclaration* nondef_class = isSgClassDeclaration(base_class->get_firstNondefiningDeclaration());
1926 if (has_defining_base)
1928 if (def_class != NULL)
1934 if (nondef_class != NULL)
1943 ROSE_ASSERT(typedef_symbol);
1956 ROSE_ASSERT (base_type != NULL);
1964 ROSE_ASSERT(scope != NULL);
1977 if (declaration != NULL)
1982 ROSE_ASSERT(parent_scope != NULL);
1985 SgNamedType* namedType = isSgNamedType(base_type);
1989 if (namedType != NULL)
1994 ROSE_ASSERT(declarationStatement != NULL);
1995 if (declarationStatement != NULL)
1998 if (templateInstantiationDecl != NULL)
2000 SgName name = templateInstantiationDecl->get_name();
2002 if (scope->lookup_template_typedef_symbol(name) != NULL)
2004 printf (
"Error: it appears that there is already a symbol in scope = %p = %s for name = %s \n",scope,scope->
class_name().c_str(),name.str());
2006 ROSE_ASSERT(scope->lookup_template_typedef_symbol(name) == NULL);
2014 ROSE_ASSERT(type_decl != NULL);
2021 ROSE_ASSERT(type_decl->get_type() == NULL);
2024 ROSE_ASSERT(typedefType != NULL);
2027 type_decl->set_type(typedefType);
2030 ROSE_ASSERT(type_decl->get_type() != NULL);
2040 SgNamedType* namedType = isSgNamedType(base_type);
2044 if (namedType != NULL)
2049 ROSE_ASSERT(declarationStatement != NULL);
2050 if (declarationStatement != NULL)
2053 if (templateInstantiationDecl != NULL)
2055 SgName name = templateInstantiationDecl->get_name();
2057 if (scope->lookup_template_typedef_symbol(name) != NULL)
2059 printf (
"Error: it appears that there is already a symbol in scope = %p = %s for name = %s \n",scope,scope->
class_name().c_str(),name.str());
2061 ROSE_ASSERT(scope->lookup_template_typedef_symbol(name) == NULL);
2067 ROSE_ASSERT(typedef_symbol);
2072 ROSE_ASSERT(scope->lookup_template_typedef_symbol(name) != NULL);
2077#define DEBUG__SageBuilder__buildTemplateInstantiationTypedefDeclaration_nfi 0
2083 SgTemplateArgumentPtrList & templateArgumentsList
2085#if DEBUG__SageBuilder__buildTemplateInstantiationTypedefDeclaration_nfi
2086 std::cout <<
"SageBuilder::buildTemplateInstantiationTypedefDeclaration_nfi" << std::endl;
2087 std::cout <<
" name = " << name.getString() << std::endl;
2088 std::cout <<
" base_type = " << std::hex << base_type <<
" : " << ( base_type ? base_type->
class_name() :
"" ) << std::endl;
2090 ROSE_ASSERT (base_type != NULL);
2092 SgName nameWithoutTemplateArguments = name;
2094#if DEBUG__SageBuilder__buildTemplateInstantiationTypedefDeclaration_nfi
2095 std::cout <<
" nameWithoutTemplateArguments = " << nameWithoutTemplateArguments.getString() << std::endl;
2096 std::cout <<
" nameWithTemplateArguments = " << nameWithTemplateArguments.getString() << std::endl;
2100 ROSE_ASSERT(scope != NULL);
2112 if (declaration != NULL)
2117 ROSE_ASSERT(parent_scope != NULL);
2122 ROSE_ASSERT(templateTypedefDeclaration != NULL);
2124 SgTemplateTypedefSymbol* prexisting_template_typedef_symbol = scope->lookup_template_typedef_symbol(nameWithTemplateArguments);
2125 if (prexisting_template_typedef_symbol != NULL)
2128 ROSE_ASSERT(declarationStatement != NULL);
2130 ROSE_ASSERT(return_declaration != NULL);
2131 return return_declaration;
2133 ROSE_ASSERT(scope->lookup_template_typedef_symbol(nameWithTemplateArguments) == NULL);
2140 ROSE_ASSERT(type_decl != NULL);
2141 ROSE_ASSERT(type_decl->get_base_type() == base_type);
2143#if DEBUG__SageBuilder__buildTemplateInstantiationTypedefDeclaration_nfi
2144 std::cout <<
" type_decl = " << std::hex << type_decl <<
" : " << ( type_decl ? type_decl->
class_name() :
"" ) << std::endl;
2145 std::cout <<
" ->get_base_type() = " << std::hex << type_decl->get_base_type() <<
" : " << ( type_decl->get_base_type() ? type_decl->get_base_type()->
class_name() :
"" ) << std::endl;
2150 ROSE_ASSERT(type_decl->get_type() == NULL);
2154 type_decl->set_templateName(nameWithoutTemplateArguments);
2156 ROSE_ASSERT(scope != NULL);
2161 ROSE_ASSERT(type_decl->get_name() == nameWithTemplateArguments);
2164 if (scope->lookup_template_typedef_symbol(nameWithTemplateArguments) != NULL)
2166 printf (
"Error: it appears that there is already a symbol in scope = %p = %s for name = %s \n",scope,scope->
class_name().c_str(),name.str());
2168 ROSE_ASSERT(scope->lookup_template_typedef_symbol(nameWithTemplateArguments) == NULL);
2172 ROSE_ASSERT(type_decl->get_type() == NULL);
2175 ROSE_ASSERT(new_typedefType != NULL);
2177 type_decl->set_type(new_typedefType);
2178 ROSE_ASSERT(type_decl->get_type() != NULL);
2179 ROSE_ASSERT(type_decl->
get_scope() != NULL);
2186 SgName mangled_name = type_decl->get_mangled_name();
2193 ROSE_ASSERT(type_decl->get_type() != NULL);
2194 ROSE_ASSERT(scope != NULL);
2196#if DEBUG__SageBuilder__buildTemplateInstantiationTypedefDeclaration_nfi
2197 std::cout <<
" type_decl = " << std::hex << type_decl <<
" : " << ( type_decl ? type_decl->
class_name() :
"" ) << std::endl;
2198 std::cout <<
" ->get_base_type() = " << std::hex << type_decl->get_base_type() <<
" : " << ( type_decl->get_base_type() ? type_decl->get_base_type()->
class_name() :
"" ) << std::endl;
2203 if (scope->lookup_template_typedef_symbol(nameWithTemplateArguments) != NULL)
2205 printf (
"Error: it appears that there is already a symbol in scope = %p = %s for nameWithTemplateArguments = %s \n",scope,scope->
class_name().c_str(),nameWithTemplateArguments.str());
2207 ROSE_ASSERT(scope->lookup_template_typedef_symbol(nameWithTemplateArguments) == NULL);
2210 ROSE_ASSERT(typedef_symbol);
2212 scope->
insert_symbol(nameWithTemplateArguments,typedef_symbol);
2215 ROSE_ASSERT(scope->lookup_template_typedef_symbol(nameWithTemplateArguments) != NULL);
2218#if DEBUG__SageBuilder__buildTemplateInstantiationTypedefDeclaration_nfi
2219 std::cout <<
" type_decl = " << std::hex << type_decl <<
" : " << ( type_decl ? type_decl->
class_name() :
"" ) << std::endl;
2220 std::cout <<
" ->get_base_type() = " << std::hex << type_decl->get_base_type() <<
" : " << ( type_decl->get_base_type() ? type_decl->get_base_type()->
class_name() :
"" ) << std::endl;
2236 ROSE_ASSERT (parameterList);
2252 if (in10)
appendArg(parameterList, in10);
2254 return parameterList;
2260 ROSE_ASSERT (parameterList);
2266 return parameterList;
2273 ROSE_ASSERT (ctorInitList);
2279 return ctorInitList;
2288 if (paralist == NULL)
2290 printf (
"WARNING: In buildFunctionParameterTypeList(): Accepting NULL input and returning NULL pointer. \n");
2300 ROSE_ASSERT(typePtrList != NULL);
2302 SgInitializedNamePtrList args = paralist->
get_args();
2303 SgInitializedNamePtrList::const_iterator i;
2304 for(i = args.begin(); i != args.end(); i++)
2305 (typePtrList->
get_arguments()).push_back( (*i)->get_type() );
2316 if (expList ==NULL)
return NULL;
2317 SgExpressionPtrList expPtrList = expList->get_expressions();
2320 ROSE_ASSERT(typePtrList);
2322 SgExpressionPtrList::const_iterator i;
2323 for (i=expPtrList.begin();i!=expPtrList.end();i++)
2338 ROSE_ASSERT(typePtrList);
2342 if (type0 != NULL) types.push_back(type0);
2343 if (type1 != NULL) types.push_back(type1);
2344 if (type2 != NULL) types.push_back(type2);
2345 if (type3 != NULL) types.push_back(type3);
2346 if (type4 != NULL) types.push_back(type4);
2347 if (type5 != NULL) types.push_back(type5);
2348 if (type6 != NULL) types.push_back(type6);
2349 if (type7 != NULL) types.push_back(type7);
2361 ROSE_ASSERT(return_type != NULL);
2364 ROSE_ASSERT(typeList != NULL);
2367 ROSE_ASSERT(fTable);
2373 SgFunctionType* funcType = isSgFunctionType(fTable->lookup_function_type(typeName));
2375 if (funcType == NULL)
2379 ROSE_ASSERT(funcType);
2381 if (typeList != NULL)
2384 if (funcType->get_argument_list() != NULL)
2386 delete funcType->get_argument_list();
2387 funcType->set_argument_list(NULL);
2389 ROSE_ASSERT(funcType->get_argument_list() == NULL);
2391 funcType->set_argument_list(typeList);
2395 fTable->insert_function_type(typeName,funcType);
2415 ROSE_ASSERT(fTable != NULL);
2421 ROSE_ASSERT(typeList != NULL);
2425 SgType* typeInTable = fTable->lookup_function_type(typeName);
2428 printf (
"In buildMemberFunctionType(SgType*,SgFunctionParameterTypeList*,SgType*,int,int): fTable->lookup_function_type(typeName = %s) = %p \n",typeName.str(),typeInTable);
2429 printf (
" --- mfunc_specifier = %d ref_qualifiers = %d \n",mfunc_specifier,ref_qualifiers);
2434 if (ref_qualifiers > 0)
2436 printf (
"Exiting as a test! \n");
2442 if (typeInTable == NULL)
2444 bool has_ellipses =
false;
2448 ROSE_ASSERT(partialFunctionType != NULL);
2450 printf (
"Building a SgPartialFunctionType: partialFunctionType = %p \n",partialFunctionType);
2451 printf (
" --- partialFunctionType->isLvalueReferenceFunc() = %s \n",partialFunctionType->
isLvalueReferenceFunc() ?
"true" :
"false");
2452 printf (
" --- partialFunctionType->isRvalueReferenceFunc() = %s \n",partialFunctionType->
isRvalueReferenceFunc() ?
"true" :
"false");
2455 if (partialFunctionType->get_argument_list() != NULL)
2457 delete partialFunctionType->get_argument_list();
2458 partialFunctionType->set_argument_list(NULL);
2460 ROSE_ASSERT(partialFunctionType->get_argument_list() == NULL);
2467 partialFunctionType->set_argument_list(typeList);
2469 ROSE_ASSERT(partialFunctionType->get_argument_list() != NULL);
2478 partialFunctionType->set_argument_list(NULL);
2481 delete partialFunctionType;
2482 partialFunctionType = NULL;
2487 ROSE_ASSERT(funcType->get_argument_list() != NULL);
2490 if (typeInTable ==
nullptr)
2492 ASSERT_not_null(funcType);
2493 fTable->insert_function_type(typeName,funcType);
2499 ASSERT_require(typeInTable != funcType);
2503 funcType = isSgMemberFunctionType(typeInTable);
2504 ASSERT_not_null(funcType);
2524 ROSE_ASSERT(return_type != NULL);
2529 ROSE_ASSERT(struct_name != NULL);
2532 printf(
"In buildMemberFunctionType():\n");
2533 printf(
" - struct_name = %p (%s)\n", struct_name, struct_name->
class_name().c_str());
2538 printf (
"SageBuilder::buildMemberFunctionType(SgType*,SgFunctionParameterTypeList*,SgScopeStatement*,int,int): This function does not use the input ref_qualifiers = %x \n",ref_qualifiers);
2539 printf (
" --- mfunc_specifier = %d ref_qualifiers = %d \n",mfunc_specifier,ref_qualifiers);
2543 printf (
"Exiting as a test! \n");
2547 ROSE_ASSERT(struct_name->
get_parent() != NULL);
2551 printf(
"struct_name = %p ( %s )\n", struct_name, struct_name->
class_name().c_str());
2558 if (classDefinition == NULL && decl_scope == NULL)
2560 printf (
"Error: (classDefinition == NULL && decl_scope == NULL): struct_name = %p = %s name = %s \n",
2563 ROSE_ASSERT(classDefinition != NULL || decl_scope != NULL);
2566 if (classDefinition != NULL)
2570 else if (decl_scope != NULL)
2572 declaration = isSgDeclarationStatement(decl_scope->
get_parent());
2579 ROSE_ASSERT(declaration != NULL);
2581 if (typeList != NULL)
2585 for (SgTypePtrList::iterator i = typeListArgs.begin(); i != typeListArgs.end(); i++)
2587 printf (
" --- type argument = %p = %s \n",*i,(*i)->class_name().c_str());
2593 printf (
"WARNING: typeList == NULL \n");
2600 ROSE_ASSERT(classDeclaration != NULL || nrdecl != NULL);
2607 SgType* classType = NULL;
2608 if (classDeclaration != NULL)
2610 classType = classDeclaration->get_type();
2612 else if (decl_scope != NULL)
2614 classType = nrdecl->get_type();
2621 ROSE_ASSERT(classType != NULL);
2624 printf (
"In buildMemberFunctionType(): Calling refactored function: buildMemberFunctionType(...,classType = %p,...) \n",classType);
2631 printf (
"In buildMemberFunctionType(): DONE: Calling refactored function: buildMemberFunctionType(...,classType = %p,...) \n",classType);
2641 ROSE_ASSERT(base_type != NULL);
2643 ROSE_ASSERT(classType != NULL);
2645 return pointerToMemberType;
2663 if (type_symbol == NULL)
2666 ROSE_ASSERT(type_decl);
2672 ROSE_ASSERT(type_symbol);
2688 type_decl = type_symbol->get_declaration();
2689 result = type_decl->get_type();
2691 ROSE_ASSERT(result);
2701 ASSERT_not_null(argList);
2706 if (func_type->get_argument_list() != typeList)
2723 if (isSgMemberFunctionDeclaration(func) != NULL)
2725#ifdef ROSE_DEBUG_NEW_EDG_ROSE_CONNECTION
2726 printf (
"WARNING: setting parent of function to match scope by default \n");
2730 ROSE_ASSERT(scope != NULL);
2732 if (isSgTemplateInstantiationMemberFunctionDecl(func) != NULL)
2740#if !ENFORCE_NO_FUNCTION_TEMPLATE_DECLARATIONS_IN_TEMPLATE_CLASS_INSTANTIATIONS
2747 if (isSgTemplateFunctionDeclaration(func) != NULL)
2749 if (isSgTemplateInstantiationMemberFunctionDecl(func) != NULL)
2751 ROSE_ASSERT(isSgTemplateClassDefinition(scope) != NULL);
2763template <
class actualFunction>
2765SageBuilder::buildNondefiningFunctionDeclaration_T (
2768 SgTemplateArgumentPtrList* templateArgumentsList, SgTemplateParameterPtrList* templateParameterList,
2779 if (scope ==
nullptr)
2783 ASSERT_not_null(scope);
2785 if (XXX_name.is_null() ==
true)
2788 mprintf (
"NOTE: In buildNondefiningFunctionDeclaration_T(): XXX_name.is_null() == true: This is a function with an empty name (allowed as compiler generated initializing constructors to un-named classes, structs, and unions in C++ \n");
2791 SgName nameWithoutTemplateArguments = XXX_name;
2792 SgName nameWithTemplateArguments = nameWithoutTemplateArguments;
2794 bool buildTemplateInstantiation = ((VariantT)actualFunction::static_variant == V_SgTemplateInstantiationFunctionDecl || (VariantT)actualFunction::static_variant == V_SgTemplateInstantiationMemberFunctionDecl);
2797 bool buildTemplateDeclaration = ((VariantT)actualFunction::static_variant == V_SgTemplateFunctionDeclaration || (VariantT)actualFunction::static_variant == V_SgTemplateMemberFunctionDeclaration);
2801 if (buildTemplateInstantiation ==
true)
2803 ASSERT_not_null(templateArgumentsList);
2808 if (nameWithTemplateArguments.is_null() ==
true)
2812 mprintf (
"NOTE: In buildNondefiningFunctionDeclaration_T(): nameWithTemplateArguments.is_null() == true: This is a function with an empty name (allowed as compiler generated initializing constructors to un-named classes, structs, and unions in C++ \n");
2815 if (nameWithoutTemplateArguments.is_null() ==
true)
2819 mprintf (
"NOTE: In buildNondefiningFunctionDeclaration_T(): nameWithoutTemplateArguments.is_null() == true: This is a function with an empty name (allowed as compiler generated initializing constructors to un-named classes, structs, and unions in C++ \n");
2822 ASSERT_not_null(return_type);
2823 ASSERT_not_null(paralist);
2829#ifdef ROSE_DEBUG_NEW_EDG_ROSE_CONNECTION
2830 printf (
"Warning: In buildNondefiningFunctionDeclaration_T(): nameWithoutTemplateArguments = %s nameWithTemplateArguments = %s \n",nameWithoutTemplateArguments.str(),nameWithTemplateArguments.str());
2840 if (isMemberFunction ==
true)
2850 ASSERT_not_null(func_type);
2853 actualFunction* func =
nullptr;
2871 func_symbol = scope->find_symbol_by_type_of_function<actualFunction>(nameWithTemplateArguments,func_type,templateParameterList,templateArgumentsList);
2874 printf (
"In buildNondefiningFunctionDeclaration_T(): func_symbol from scope->find_symbol_by_type_of_function<actualFunction>(name = %s) = %p \n",nameWithTemplateArguments.str(),func_symbol);
2875 if (func_symbol != NULL) {
2876 printf (
"In buildNondefiningFunctionDeclaration_T(): func_symbol->get_declaration() = %p \n", func_symbol->get_declaration());
2881 if (func_symbol == NULL)
2884 ROSE_ASSERT(func_type != NULL);
2889 if (func_symbol != NULL)
2891 switch((VariantT)actualFunction::static_variant)
2893 case V_SgFunctionDeclaration:
2894 case V_SgProcedureHeaderStatement:
2895 case V_SgTemplateInstantiationFunctionDecl:
2897 ROSE_ASSERT(isSgFunctionSymbol(func_symbol) != NULL);
2900 case V_SgMemberFunctionDeclaration:
2901 case V_SgTemplateInstantiationMemberFunctionDecl:
2903 ROSE_ASSERT(isSgMemberFunctionSymbol(func_symbol) != NULL);
2906 case V_SgTemplateFunctionDeclaration:
2908 ROSE_ASSERT(isSgTemplateFunctionSymbol(func_symbol) != NULL);
2911 case V_SgTemplateMemberFunctionDeclaration:
2913 ROSE_ASSERT(isSgTemplateMemberFunctionSymbol(func_symbol) != NULL);
2919 printf (
"default reach in buildNondefiningFunctionDeclaration_T(): variantT(actualFunction::static_variant) = %d \n",actualFunction::static_variant);
2926 ROSE_ASSERT(scope != NULL);
2927 if ( isSgGlobal(scope) != NULL
2928 && scope != func_symbol->get_scope()
2930 && !scope->symbol_exists(nameWithTemplateArguments, func_symbol) )
2932 scope->
insert_symbol(nameWithTemplateArguments, func_symbol);
2936 if (func_symbol == NULL)
2938 func =
new actualFunction (nameWithTemplateArguments,func_type,NULL);
2939 ROSE_ASSERT(func != NULL);
2942 func->get_declarationModifier().get_storageModifier().set_modifier(sm);
2945 ROSE_ASSERT(func->get_file_info() == NULL);
2948 func->set_scope(scope);
2951 checkThatNoTemplateInstantiationIsDeclaredInTemplateDefinitionScope(func,scope);
2954 ROSE_ASSERT(func->get_parameterList() != NULL);
2962 if (isSgMemberFunctionDeclaration(func))
2967 if (isSgTemplateMemberFunctionDeclaration(func) != NULL)
2972 ROSE_ASSERT(memberFunctionDeclaration != NULL);
2976 ROSE_ASSERT(func_symbol != NULL);
2977 ROSE_ASSERT(func_symbol->get_symbol_basis() != NULL);
2982 if (isSgTemplateFunctionDeclaration(func))
2988 ROSE_ASSERT(templatedeclaration != NULL);
2990 ROSE_ASSERT(template_symbol != NULL);
2991 ROSE_ASSERT(template_symbol->get_symbol_basis() != NULL);
2992 func_symbol = template_symbol;
2997 ROSE_ASSERT(func_symbol->get_symbol_basis() != NULL);
3001 ROSE_ASSERT(func_symbol != NULL);
3002 ROSE_ASSERT(func_symbol->get_symbol_basis() != NULL);
3003 scope->
insert_symbol(nameWithTemplateArguments, func_symbol);
3006 ROSE_ASSERT(func->get_symbol_from_symbol_table() != NULL);
3008 if (isSgFunctionDeclaration(func) == NULL)
3014 ROSE_ASSERT(scope->lookup_template_function_symbol(nameWithTemplateArguments,func_type,templateParameterList) != NULL);
3022 ROSE_ASSERT(buildTemplateDeclaration ==
false || templateParameterList != NULL);
3028 ROSE_ASSERT(scope->lookup_function_symbol(nameWithTemplateArguments) != NULL ||
3029 scope->lookup_template_function_symbol(nameWithTemplateArguments,func_type,templateParameterList) != NULL ||
3030 scope->lookup_template_member_function_symbol(nameWithTemplateArguments,func_type,templateParameterList) != NULL);
3032#if BUILDER_MAKE_REDUNDANT_CALLS_TO_SYMBOL_TABLE_LOOKUP
3036 if (scope->lookup_function_symbol(nameWithTemplateArguments,templateArgumentList) == NULL || scope->lookup_template_symbol(nameWithTemplateArguments,templateParameterList,NULL) != NULL)
3039 printf (
"Need to make sure this is a template function declaration... \n");
3045 ROSE_ASSERT(func->get_scope() != NULL);
3047 if (isSgFunctionDeclaration(func) == NULL)
3053 ROSE_ASSERT(scope->lookup_template_function_symbol(nameWithTemplateArguments,func_type,templateParameterList) != NULL);
3055 func->set_firstNondefiningDeclaration(func);
3056 func->set_definingDeclaration(NULL);
3059 ROSE_ASSERT(func->get_firstNondefiningDeclaration() == func);
3061 ROSE_ASSERT(func->get_definingDeclaration() == NULL);
3065 if (testMemberDecl != NULL)
3067 ROSE_ASSERT(testMemberDecl->
get_scope() != NULL);
3068 ROSE_ASSERT(testMemberDecl->get_class_scope() != NULL);
3069 ROSE_ASSERT(testMemberDecl->get_associatedClassDeclaration() != NULL);
3074 ROSE_ASSERT(func_symbol != NULL);
3076 ROSE_ASSERT(scope != NULL);
3084 SgNode* associatedSymbolBasis = func_symbol->get_symbol_basis();
3085 ROSE_ASSERT(associatedSymbolBasis != NULL);
3088 ROSE_ASSERT(associatedDeclaration != NULL);
3092 if (functionDeclaration != NULL)
3094 func_type = functionDeclaration->get_type();
3098 if (templateFunctionDeclaration != NULL)
3103 printf (
"This code should not be reachable! \n");
3106 func_type = templateFunctionDeclaration->get_type();
3114 ROSE_ASSERT(func_type != NULL);
3116 func =
new actualFunction(nameWithTemplateArguments,func_type,NULL);
3117 ROSE_ASSERT(func != NULL);
3119#if BUILDER_MAKE_REDUNDANT_CALLS_TO_DETECT_TRANSFORAMTIONS
3126 func->set_scope(scope);
3129 ROSE_ASSERT(func->get_symbol_from_symbol_table() == NULL);
3132 checkThatNoTemplateInstantiationIsDeclaredInTemplateDefinitionScope(func,scope);
3138 if (functionDeclaration != NULL)
3140 prevDecl = functionDeclaration;
3144 ROSE_ASSERT(templateFunctionDeclaration != NULL);
3145 prevDecl = templateFunctionDeclaration;
3148 ROSE_ASSERT(prevDecl != NULL);
3155 printf (
"WARNING: Switching declaration in functionSymbol to point to the non-defining declaration \n");
3156 function_symbol->set_declaration(isSgFunctionDeclaration(func));
3157 ROSE_ASSERT(function_symbol->get_declaration() != NULL);
3162 if (nondefiningDeclaration == NULL)
3164 nondefiningDeclaration = func;
3167 ROSE_ASSERT(nondefiningDeclaration != NULL);
3168 ROSE_ASSERT(func != NULL);
3169 ROSE_ASSERT(prevDecl != NULL);
3171 func->set_firstNondefiningDeclaration(nondefiningDeclaration);
3175 ROSE_ASSERT(func->get_firstNondefiningDeclaration()->get_symbol_from_symbol_table() != NULL);
3179 if (func->get_symbol_from_symbol_table() == NULL)
3181 ROSE_ASSERT(nondefiningDeclaration != NULL);
3182 ROSE_ASSERT(func->get_firstNondefiningDeclaration() == nondefiningDeclaration);
3186 ROSE_ASSERT(scope != NULL);
3187 ROSE_ASSERT(func->get_scope() != NULL);
3188 ROSE_ASSERT(func->get_scope() == scope);
3192 if (testMemberDecl != NULL)
3194 ROSE_ASSERT(testMemberDecl->
get_scope() != NULL);
3195 ROSE_ASSERT(testMemberDecl->get_associatedClassDeclaration() != NULL);
3199 if (isSgFunctionDeclaration(func) == NULL)
3210 ROSE_ASSERT(scope->lookup_template_function_symbol(nameWithTemplateArguments,func_type,templateParameterList) != NULL);
3214 ROSE_ASSERT(func != NULL);
3216 ROSE_ASSERT(func->get_file_info() == NULL);
3219 ROSE_ASSERT(func->get_firstNondefiningDeclaration() != NULL);
3220 ROSE_ASSERT(func_symbol != NULL);
3221 ROSE_ASSERT(func_symbol->get_symbol_basis() == func->get_firstNondefiningDeclaration());
3222 ROSE_ASSERT(func->get_symbol_from_symbol_table() != NULL || func->get_firstNondefiningDeclaration()->get_symbol_from_symbol_table() != NULL);
3225 ROSE_ASSERT(func->get_parameterList() != NULL);
3226 delete func->get_parameterList();
3227 func->set_parameterList(NULL);
3230 if (buildTemplateInstantiation ==
true)
3236 if (buildTemplateDeclaration ==
true)
3242 ROSE_ASSERT(templateFunctionDeclaration == NULL || (templateParameterList != NULL && templateParameterList->size() == templateFunctionDeclaration->get_templateParameters().size()));
3245 ROSE_ASSERT(templateMemberFunctionDeclaration == NULL || (templateParameterList != NULL && templateParameterList->size() == templateMemberFunctionDeclaration->get_templateParameters().size()));
3254 i_name->set_scope(scope);
3259 printf (
"In buildNondefiningFunctionDeclaration_T(): setting the source position information (calling setTransformation()) \n");
3267 printf (
"In buildNondefiningFunctionDeclaration_T(): DONE: setting the source position information (calling setTransformation()) \n");
3270#if BUILDER_MAKE_REDUNDANT_CALLS_TO_DETECT_TRANSFORAMTIONS
3272 if (SourcePositionClassificationMode != e_sourcePositionTransformation)
3274 detectTransformations_local(paralist);
3278 ASSERT_not_null(scope);
3279 ASSERT_not_null(func->get_scope());
3280 ASSERT_require(func->get_scope() == scope);
3288#ifdef ROSE_DEBUG_NEW_EDG_ROSE_CONNECTION
3289 printf (
"Warning: SageBuilder::buildNondefiningFunctionDeclaration_T(): scope parameter may not be the same as the topScopeStack() (e.g. for member functions) \n");
3294 func->set_parent(scope);
3295 ASSERT_not_null(func->get_firstNondefiningDeclaration());
3300 ROSE_ASSERT(func->get_file_info() == NULL);
3305 ROSE_ASSERT(func->get_file_info() != NULL);
3307#if BUILDER_MAKE_REDUNDANT_CALLS_TO_DETECT_TRANSFORAMTIONS
3309 if (SourcePositionClassificationMode != e_sourcePositionTransformation)
3311 detectTransformations_local(func);
3321 ROSE_ASSERT (f_func != NULL);
3335 ROSE_ASSERT(func->get_firstNondefiningDeclaration() != NULL);
3336 SgSymbol* symbol_from_first_nondefining_function = func->get_firstNondefiningDeclaration()->get_symbol_from_symbol_table();
3337 ROSE_ASSERT(symbol_from_first_nondefining_function != NULL);
3340 if (func != func->get_firstNondefiningDeclaration())
3342 SgSymbol* symbol_from_nondefining_function = func->get_symbol_from_symbol_table();
3343 ROSE_ASSERT(symbol_from_nondefining_function == NULL);
3347 if (isSgFunctionDeclaration(func) == NULL)
3353 ROSE_ASSERT(scope->lookup_template_function_symbol(nameWithTemplateArguments,func_type,templateParameterList) != NULL);
3359#if BUILDER_MAKE_REDUNDANT_CALLS_TO_DETECT_TRANSFORAMTIONS
3361 if (SourcePositionClassificationMode !=e_sourcePositionTransformation)
3363 detectTransformations_local(func);
3368 if (functionConstVolatileFlags & SgMemberFunctionType::e_restrict)
3370 func->get_declarationModifier().get_typeModifier().setRestrict();
3378 unsetNodesMarkedAsModified(func);
3389 ROSE_ASSERT(funcdecl!=NULL);
3390 SgName name=funcdecl->get_name();
3392 SgType* return_type = funcType->get_return_type();
3397 ROSE_ASSERT(funcType== ref_funcType);
3402 returnFunction->set_linkage(funcdecl->get_linkage());
3403 if (funcdecl->get_declarationModifier().get_storageModifier().
isExtern() ==
true)
3405 returnFunction->get_declarationModifier().get_storageModifier().
setExtern();
3408 ROSE_ASSERT (returnFunction->get_linkage() == funcdecl->get_linkage());
3409 ROSE_ASSERT (returnFunction->get_declarationModifier().get_storageModifier().
isExtern() ==
3410 funcdecl->get_declarationModifier().get_storageModifier().
isExtern());
3419 return returnFunction;
3428 result = buildNondefiningFunctionDeclaration_T <SgProcedureHeaderStatement> (name,return_type,paralist,
false, scope, decoratorList,
false, NULL, NULL, sm);
3433 if (buildTemplateInstantiation ==
true)
3435 result = buildNondefiningFunctionDeclaration_T <SgTemplateInstantiationFunctionDecl> (name,return_type,paralist,
false, scope, decoratorList,
false, templateArgumentsList, NULL, sm);
3439 result = buildNondefiningFunctionDeclaration_T <SgFunctionDeclaration> (name,return_type,paralist,
false, scope, decoratorList,
false, NULL, NULL, sm);
3452 unsigned int memberFunctionModifiers = 0;
3466 unsigned int memberFunctionModifiers = 0;
3473 if (member_func_symbol != NULL)
3475 nondefining_decl = member_func_symbol->get_declaration();
3499 ROSE_ASSERT(result != NULL);
3519 ROSE_ASSERT(first_nondefining_declaration != NULL);
3526 SgTemplateFunctionDeclaration* result = buildDefiningFunctionDeclaration_T <SgTemplateFunctionDeclaration> (name,return_type,paralist,
false, scope, decoratorList, 0, first_nondefining_declaration, NULL);
3538 SgTemplateMemberFunctionDeclaration* result = buildDefiningFunctionDeclaration_T <SgTemplateMemberFunctionDeclaration> (name,return_type,paralist,
true, scope, decoratorList, functionConstVolatileFlags, first_nondefining_declaration, NULL);
3539 ROSE_ASSERT(result != NULL);
3541 ROSE_ASSERT(result->get_definition() != NULL);
3548 SgExprListExp* decoratorList,
unsigned int functionConstVolatileFlags,
bool buildTemplateInstantiation, SgTemplateArgumentPtrList* templateArgumentsList)
3555 if (buildTemplateInstantiation ==
true)
3558 result = buildNondefiningFunctionDeclaration_T <SgTemplateInstantiationMemberFunctionDecl> (name,return_type,paralist,
true,scope,decoratorList,functionConstVolatileFlags,templateArgumentsList,NULL,
SgStorageModifier::e_default);
3563 result = buildNondefiningFunctionDeclaration_T <SgMemberFunctionDeclaration> (name,return_type,paralist,
true,scope,decoratorList,functionConstVolatileFlags,NULL,NULL,
SgStorageModifier::e_default);
3565 ROSE_ASSERT(result != NULL);
3569 ROSE_ASSERT(ctor != NULL);
3576 ROSE_ASSERT(result->get_associatedClassDeclaration() != NULL);
3578 if (result->get_associatedClassDeclaration() == NULL)
3580 printf (
"Warning, must set the SgMemberFunctionDeclaration::associatedClassDeclaration \n");
3582 ROSE_ASSERT(scope != NULL);
3584 ROSE_ASSERT(classDefinition != NULL);
3586 ROSE_ASSERT(associatedDeclaration != NULL);
3587 SgClassDeclaration* associatedClassDeclaration = isSgClassDeclaration(associatedDeclaration);
3608 ROSE_ASSERT(result != NULL);
3610#if BUILDER_MAKE_REDUNDANT_CALLS_TO_DETECT_TRANSFORAMTIONS
3614 detectTransformations_local(result);
3621 SgSymbol* associatedSymbol = scope->lookup_template_member_function_symbol(name,result->get_type(),templateParameterList);
3622 if (associatedSymbol == NULL)
3624 printf (
"ERROR: associatedSymbol == NULL \n");
3625 printf (
" --- result = %p = %s \n",result,result->
class_name().c_str());
3626 printf (
" --- scope = %p = %s \n",scope,scope->
class_name().c_str());
3627 printf (
" --- name = %s \n",name.str());
3628 printf (
" --- result->get_type() = %p = %s \n",result->get_type(),result->get_type()->
class_name().c_str());
3629 printf (
" --- result->get_type()->get_mangled() = %s \n",result->get_type()->get_mangled().str());
3631 ROSE_ASSERT(associatedSymbol != NULL);
3634 ROSE_ASSERT(ctor != NULL);
3642 ROSE_ASSERT(symbol_from_first_nondefining_function != NULL);
3648 ROSE_ASSERT(symbol_from_nondefining_function == NULL);
3651#if BUILDER_MAKE_REDUNDANT_CALLS_TO_SYMBOL_TABLE_LOOKUP
3654 if (scope->lookup_template_member_function_symbol(name,result->get_type(),templateParameterList) == NULL)
3656 printf (
"Error: scope->lookup_template_member_function_symbol(name,result->get_type()) == NULL (investigate this) \n");
3657 printf (
"--- function name = %s in scope = %p = %s result->get_type() = %p = %s \n",name.str(),scope,scope->
class_name().c_str(),result->get_type(),result->get_type()->
class_name().c_str());
3658 scope->
get_symbol_table()->
print(
"Error: scope->lookup_template_member_function_symbol(name,result->get_type()) == NULL (investigate this)");
3661 ROSE_ASSERT(scope->lookup_template_member_function_symbol(name,result->get_type(),templateParameterList) != NULL);
3663#if BUILDER_MAKE_REDUNDANT_CALLS_TO_DETECT_TRANSFORAMTIONS
3667 detectTransformations_local(result);
3679 if (buildTemplateInstantiation ==
true)
3682 ROSE_ASSERT(templateInstantiationMemberFunctionDecl != NULL);
3686 ROSE_ASSERT(templateArgumentsList != NULL);
3687 string nameWithoutTemplateArguments = name;
3689 SgMemberFunctionType* func_type = isSgMemberFunctionType(first_nondefining_declaration->get_type());
3690 ROSE_ASSERT(func_type != NULL);
3694 if (func_symbol == NULL)
3696 printf (
"ERROR caught in SageBuilder::buildDefiningMemberFunctionDeclaration(): nameWithTemplateArguments = %s buildTemplateInstantiation = %s \n",nameWithTemplateArguments.c_str(),buildTemplateInstantiation ?
"true:" :
"false");
3697 printf (
"ERROR caught in SageBuilder::buildDefiningMemberFunctionDeclaration(): func_symbol == NULL for first_nondefining_declaration = %p = %s and func_type = %p = %s \n",
3698 templateInstantiationMemberFunctionDecl,templateInstantiationMemberFunctionDecl->
class_name().c_str(),func_type,func_type->
class_name().c_str());
3702 result = buildDefiningFunctionDeclaration_T <SgTemplateInstantiationMemberFunctionDecl> (name, return_type, paralist,
true, scope, decoratorList, functionConstVolatileFlags, templateInstantiationMemberFunctionDecl, templateArgumentsList);
3703 ROSE_ASSERT(isSgTemplateInstantiationMemberFunctionDecl(result) != NULL);
3704 ROSE_ASSERT(isSgTemplateInstantiationMemberFunctionDecl(result)->get_templateName().is_null() ==
false);
3708 ROSE_ASSERT(first_nondefining_declaration != NULL);
3714 result = buildDefiningFunctionDeclaration_T <SgMemberFunctionDeclaration> (name,return_type,paralist,
true,scope,decoratorList,functionConstVolatileFlags,first_nondefining_declaration, NULL);
3717 ROSE_ASSERT(result != NULL);
3721 ROSE_ASSERT(ctor != NULL);
3728 ROSE_ASSERT(result->get_associatedClassDeclaration() != NULL);
3738template <
class actualFunction>
3747#ifdef ROSE_DEBUG_NEW_EDG_ROSE_CONNECTION
3748 printf (
"WARNING: This function for building defining function declarations has different semantics from that of the function to build defining class declarations. \n");
3751 ASSERT_not_null(first_nondefining_declaration);
3752 ASSERT_require(first_nondefining_declaration->get_firstNondefiningDeclaration() == first_nondefining_declaration);
3754 if (scope ==
nullptr)
3759 ASSERT_require(XXX_name.is_null() ==
false);
3760 ASSERT_not_null(scope);
3761 ASSERT_not_null(return_type);
3763 SgName nameWithoutTemplateArguments = XXX_name;
3764 SgName nameWithTemplateArguments = nameWithoutTemplateArguments;
3766 bool buildTemplateInstantiation = ((VariantT)actualFunction::static_variant == V_SgTemplateInstantiationFunctionDecl || (VariantT)actualFunction::static_variant == V_SgTemplateInstantiationMemberFunctionDecl);
3769 bool buildTemplateDeclaration = ((VariantT)actualFunction::static_variant == V_SgTemplateFunctionDeclaration || (VariantT)actualFunction::static_variant == V_SgTemplateMemberFunctionDeclaration);
3772 if (buildTemplateInstantiation ==
true)
3774 ASSERT_not_null(templateArgumentsList);
3776 SgTemplateArgumentPtrList & templateArgumentsList_from_first_nondefining_declaration = (isMemberFunction ==
false) ?
3778 isSgTemplateInstantiationMemberFunctionDecl(first_nondefining_declaration)->
get_templateArguments();
3780 ASSERT_not_null(templateArgumentsList);
3782 ASSERT_require(templateArgumentListsAreEquivalent ==
true);
3785 SgTemplateParameterPtrList* templateParameterList =
nullptr;
3786 if (buildTemplateDeclaration ==
true)
3789 templateParameterList = (isMemberFunction ==
false) ?
3790 &(isSgTemplateFunctionDeclaration(first_nondefining_declaration)->get_templateParameters()) :
3791 &(isSgTemplateMemberFunctionDeclaration(first_nondefining_declaration)->get_templateParameters());
3793 ASSERT_require(templateArgumentsList ==
nullptr);
3794 ASSERT_not_null(templateParameterList);
3797 if (buildTemplateInstantiation ==
true)
3799 ASSERT_not_null(templateArgumentsList);
3802 if (nameWithTemplateArguments ==
"insert < __normal_iterator< SgInitializedName ** , __type > > ")
3804 printf (
"In buildDefiningFunctionDeclaration_T(): Found function nameWithTemplateArguments = %s \n",nameWithTemplateArguments.str());
3808 ASSERT_require(nameWithoutTemplateArguments.is_null() ==
false);
3809 ASSERT_require(nameWithTemplateArguments.is_null() ==
false);
3810 ASSERT_not_null(paralist);
3818 actualFunction* defining_func =
nullptr;
3824 ASSERT_not_null(first_nondefining_declaration);
3841 func_type = first_nondefining_declaration->get_type();
3842 ASSERT_not_null(func_type);
3845 ASSERT_require(func_type == first_nondefining_declaration->get_type());
3850 SgSymbol* func_symbol = scope->find_symbol_by_type_of_function<actualFunction>(nameWithTemplateArguments,func_type,templateParameterList,templateArgumentsList);
3853 ASSERT_not_null(func_symbol);
3855 if (func_symbol ==
nullptr)
3860 printf (
"Error: building a defining declaration requires that the associated non-defining declaration already exists and it's symbol found the the same scope's symbol table! \n");
3874 if (temp_function_sym !=
nullptr)
3876 func_type = temp_function_sym->get_declaration()->get_type();
3882 ASSERT_not_null(temp_template_sym);
3885 ASSERT_not_null(firstNondefiningFunctionDeclaration);
3888 defining_func =
new actualFunction(nameWithTemplateArguments,func_type,
nullptr);
3889 ASSERT_not_null(defining_func);
3891 ASSERT_not_null(firstNondefiningFunctionDeclaration);
3892 defining_func->set_firstNondefiningDeclaration(firstNondefiningFunctionDeclaration);
3898 if (decoratorList !=
nullptr)
3900 defining_func->set_decoratorList(decoratorList);
3905 defining_func->set_definingDeclaration(defining_func);
3909 ASSERT_not_null(func_body);
3915 if (templateFunctionDeclaration ==
nullptr)
3918 ASSERT_not_null(functionDeclaration);
3923 ASSERT_not_null(templateFunctionDeclaration);
3926 ASSERT_not_null(func_def);
3930 func_def->setCaseInsensitive(
true);
3931 func_body->setCaseInsensitive(
true);
3944 i_name->set_scope(func_def);
3947 ASSERT_not_null(variableSymbol);
3948 func_def->
insert_symbol(i_name->get_name(), variableSymbol);
3951 SgArrayType* arrayType = isSgArrayType(i_name->get_type());
3952 if (arrayType !=
nullptr)
3956 SgExpression* indexExpression = arrayType->get_index();
3958 if (indexExpression !=
nullptr)
3962 vector<SgVarRefExp* > varRefList;
3965 for (
size_t i = 0; i < varRefList.size(); i++)
3969 ASSERT_not_null(dimension_variableSymbol);
3970 ASSERT_require(dimension_variableSymbol != variableSymbol);
3973 SgSymbol* symbolFromLookup = func_def->lookup_symbol(dimension_variableSymbol->
get_name());
3974 if (symbolFromLookup !=
nullptr)
3976 SgVariableSymbol* variableSymbolFromLookup = isSgVariableSymbol(symbolFromLookup);
3977 ASSERT_not_null(variableSymbolFromLookup);
3979 varRefList[i]->set_symbol(variableSymbolFromLookup);
3980 ASSERT_require(dimension_variableSymbol != variableSymbol);
3991 defining_func->set_parent(scope);
3992 defining_func->set_scope(scope);
3994 ASSERT_not_null(defining_func->get_scope());
3996 checkThatNoTemplateInstantiationIsDeclaredInTemplateDefinitionScope(defining_func,scope);
4002 if (isMemberFunction ==
true)
4004 ASSERT_not_null(isSgMemberFunctionDeclaration(defining_func));
4011 if (buildTemplateInstantiation ==
true)
4017 if (buildTemplateDeclaration ==
true)
4023 ROSE_ASSERT(templateFunctionDeclaration ==
nullptr || (templateParameterList !=
nullptr && templateParameterList->size() == templateFunctionDeclaration->get_templateParameters().size()));
4025 ROSE_ASSERT(templateMemberFunctionDeclaration ==
nullptr || (templateParameterList !=
nullptr && templateParameterList->size() == templateMemberFunctionDeclaration->get_templateParameters().size()));
4029 if (functionConstVolatileFlags & SgMemberFunctionType::e_restrict)
4031 defining_func->get_declarationModifier().get_typeModifier().setRestrict();
4038 unsetNodesMarkedAsModified(defining_func);
4040 return defining_func;
4050 bool isTemplateInstantition = (templateInstantiationFunctionDecl != NULL) || (templateInstantiationMemberFunctionDecl != NULL);
4051 if (isTemplateInstantition ==
true)
4055 SgName templateNameWithoutArguments = name;
4061 bool isMemberFunction = (templateInstantiationMemberFunctionDecl != NULL);
4062 if (isMemberFunction ==
true)
4064 ROSE_ASSERT(templateInstantiationMemberFunctionDecl != NULL);
4065 ROSE_ASSERT(templateInstantiationFunctionDecl == NULL);
4067 if (templateInstantiationMemberFunctionDecl->
get_templateName().is_null() ==
true)
4071 templateInstantiationMemberFunctionDecl->
set_templateName(templateNameWithoutArguments);
4075 ROSE_ASSERT(templateInstantiationMemberFunctionDecl->
get_templateName().is_null() ==
false);
4079 ROSE_ASSERT(templateInstantiationFunctionDecl != NULL);
4080 ROSE_ASSERT(templateInstantiationMemberFunctionDecl == NULL);
4082 if (templateInstantiationFunctionDecl->
get_templateName().is_null() ==
true)
4086 templateInstantiationFunctionDecl->
set_templateName(templateNameWithoutArguments);
4091 ROSE_ASSERT(templateInstantiationFunctionDecl->
get_templateName().is_null() ==
false);
4101 if (buildTemplateInstantiation ==
true)
4105 ROSE_ASSERT(first_nondefining_declaration != NULL);
4107 func = buildDefiningFunctionDeclaration_T<SgTemplateInstantiationFunctionDecl>(name,return_type,paralist,
false,scope,decoratorList,0,templateInstantiationFunctionDecl, templateArgumentsList);
4109 ROSE_ASSERT(isSgTemplateInstantiationFunctionDecl(func) != NULL);
4110 ROSE_ASSERT(isSgTemplateInstantiationFunctionDecl(func)->get_templateName().is_null() ==
false);
4114 ROSE_ASSERT(first_nondefining_declaration != NULL);
4116 func = buildDefiningFunctionDeclaration_T<SgFunctionDeclaration>(name,return_type,paralist,
false,scope,decoratorList,0,first_nondefining_declaration, NULL);
4118 ROSE_ASSERT(isSgFunctionDeclaration(func) != NULL);
4133 ROSE_ASSERT(return_type != NULL);
4134 ROSE_ASSERT(parameter_list != NULL);
4150 if (func_symbol != NULL)
4152 nondefiningDeclaration = func_symbol->get_declaration();
4159 ROSE_ASSERT(nondefiningDeclaration != NULL);
4171 ASSERT_not_null(return_type);
4172 ASSERT_not_null(param_list);
4176 if (scope ==
nullptr) {
4182 nondef_decl = buildNondefiningFunctionDeclaration_T <SgProcedureHeaderStatement>
4183 ( name, return_type, param_list,
false, scope,
nullptr,
4186 ASSERT_not_null(isSgProcedureHeaderStatement(nondef_decl));
4189 nondef_decl->set_subprogram_kind(kind);
4198 ASSERT_not_null(return_type);
4199 ASSERT_not_null(parameter_list);
4203 if (scope ==
nullptr) {
4209 if (func_symbol ==
nullptr)
4211 nondef_decl = buildNondefiningFunctionDeclaration_T <SgProcedureHeaderStatement>
4212 ( name, return_type, parameter_list,
false, scope,
4217 nondef_decl = func_symbol->get_declaration();
4221 ASSERT_not_null(proc_header_stmt);
4234 ASSERT_not_null(firstNondefDecl);
4242 mlog[ERROR] <<
"unhandled subprogram kind for Fortran (or Jovial) function declaration:"
4247 func = buildDefiningFunctionDeclaration_T<SgProcedureHeaderStatement>(
SgName(name), returnType, params,
false,
4248 scope,
nullptr, 0U, firstNondefDecl,
nullptr);
4249 ASSERT_not_null(func);
4250 func->set_subprogram_kind(kind);
4261 ROSE_ASSERT(boolValue);
4272 ROSE_ASSERT(boolValue);
4280 ROSE_ASSERT(nullptrValue);
4282 return nullptrValue;
4288 ROSE_ASSERT(nullptrValue);
4290 return nullptrValue;
4296 ROSE_ASSERT(voidValue);
4304 ROSE_ASSERT(voidValue);
4312 ROSE_ASSERT(result);
4320 ROSE_ASSERT(result);
4328 ROSE_ASSERT(result);
4336 ROSE_ASSERT(result);
4345 ROSE_ASSERT(result);
4353 ROSE_ASSERT(result);
4362 ROSE_ASSERT(result);
4370 ROSE_ASSERT(result);
4379 ROSE_ASSERT(result);
4382 if (real_value != NULL)
4385 if (imaginary_value != NULL)
4388 ROSE_ASSERT(real_value == NULL || real_value->
get_parent() != NULL);
4389 ROSE_ASSERT(imaginary_value == NULL || imaginary_value->
get_parent() != NULL);
4397 ROSE_ASSERT(imaginary_value != NULL);
4399 ROSE_ASSERT(result != NULL);
4402 if (real_value != NULL)
4405 if (imaginary_value != NULL)
4408 ROSE_ASSERT(real_value == NULL || real_value->
get_parent() != NULL);
4409 ROSE_ASSERT(imaginary_value == NULL || imaginary_value->
get_parent() != NULL);
4418 ROSE_ASSERT(result);
4421 result->get_imaginary_value()->
set_parent(result);
4422 ROSE_ASSERT(result->get_imaginary_value()->
get_parent() != NULL);
4430 ROSE_ASSERT(imaginary_value != NULL);
4433 ROSE_ASSERT(result);
4437 ROSE_ASSERT(imaginary_value->
get_parent() != NULL);
4445 ROSE_ASSERT(imaginary_value != NULL);
4449 ROSE_ASSERT(result);
4452 ROSE_ASSERT(imaginary_value->
get_parent() != NULL);
4477 ROSE_ASSERT(result);
4485 ROSE_ASSERT(result);
4493 ROSE_ASSERT(result);
4508 ASSERT_not_null(intValue);
4516 ASSERT_not_null(intValue);
4524 ASSERT_not_null(intValue);
4532 ASSERT_not_null(intValue);
4545 ASSERT_not_null(intValue);
4553 ASSERT_not_null(intValue);
4561 ASSERT_not_null(intValue);
4569 ASSERT_not_null(intValue);
4577 ASSERT_not_null(enumVal);
4586 ASSERT_not_null(enumVal);
4593 ROSE_ASSERT(init_name != NULL);
4595 ROSE_ASSERT(assign_init != NULL);
4596 SgEnumVal * enum_val = isSgEnumVal(assign_init->get_operand_i());
4597 ROSE_ASSERT(enum_val != NULL);
4605 ASSERT_not_null(result);
4613 ASSERT_not_null(result);
4621 ASSERT_not_null(result);
4629 ASSERT_not_null(result);
4637 ASSERT_not_null(result);
4645 ASSERT_not_null(result);
4653 ASSERT_not_null(result);
4661 ASSERT_not_null(result);
4669 ASSERT_not_null(result);
4677 ASSERT_not_null(result);
4685 ASSERT_not_null(result);
4693 ASSERT_not_null(result);
4701 ASSERT_not_null(result);
4709 ASSERT_not_null(result);
4717 ASSERT_not_null(result);
4725 ASSERT_not_null(result);
4733 ASSERT_not_null(result);
4741 ASSERT_not_null(result);
4749 ASSERT_not_null(result);
4757 ASSERT_not_null(result);
4765 ASSERT_not_null(result);
4773 ASSERT_not_null(result);
4781 ASSERT_not_null(result);
4789 ASSERT_not_null(result);
4797 ASSERT_not_null(result);
4805 ASSERT_not_null(result);
4812 SgJovialBitVal* result =
new SgJovialBitVal(str);
4813 ASSERT_not_null(result);
4821 ASSERT_not_null (result);
4830 ROSE_ASSERT (result);
4838 ROSE_ASSERT(templateParameterValue);
4842 ROSE_ASSERT(templateParameterValue->
get_parent() == NULL);
4844 return templateParameterValue;
4850 ROSE_ASSERT(templateParameterValue);
4854 ROSE_ASSERT(templateParameterValue->
get_parent() == NULL);
4856 return templateParameterValue;
4859#define DEBUG_BUILD_NONREAL_DECL 0
4862 ROSE_ASSERT(scope != NULL);
4863#if DEBUG_BUILD_NONREAL_DECL
4864 printf(
"ENTER SageBuilder::buildNonrealDecl\n");
4865 printf(
" --- name = %s\n", name.str());
4866 printf(
" --- scope = %p (%s)\n", scope, scope->
class_name().c_str());
4874#if DEBUG_BUILD_NONREAL_DECL
4875 printf(
" --- nrdecl = %p (%s)\n", nrdecl, nrdecl->
class_name().c_str());
4880#if DEBUG_BUILD_NONREAL_DECL
4881 printf(
" --- symbol = %p (%s)\n", symbol, symbol->
class_name().c_str());
4885 type->set_declaration(nrdecl);
4887 nrdecl->set_type(type);
4889#if DEBUG_BUILD_NONREAL_DECL
4890 printf(
" --- type = %p (%s)\n", type, type->
class_name().c_str());
4893 if (child_scope == NULL) {
4895#if DEBUG_BUILD_NONREAL_DECL
4896 printf(
" --- child_scope = %p (new)\n", name.str(), child_scope);
4902#if DEBUG_BUILD_NONREAL_DECL
4903 printf(
" --- child_scope = %p (provided)\n", name.str(), child_scope);
4908 nrdecl->set_nonreal_decl_scope(child_scope);
4910#if DEBUG_BUILD_NONREAL_DECL
4911 printf(
"LEAVE SageBuilder::buildNonrealDecl\n");
4921 ROSE_ASSERT(result);
4930 ROSE_ASSERT(result);
4939 ROSE_ASSERT(result);
4948 ROSE_ASSERT(result);
4956 ROSE_ASSERT(result);
4964 ROSE_ASSERT(result);
4972 ROSE_ASSERT(result);
4980 ROSE_ASSERT(result);
4988 ROSE_ASSERT(result);
4996 ROSE_ASSERT(result);
5092#define BUILD_UNARY_DEF(suffix) \
5093 ROSE_DLL_API Sg##suffix* SageBuilder::build##suffix##_nfi(SgExpression* op) \
5095 return SageBuilder::buildUnaryExpression_nfi<Sg##suffix>(op); \
5097 ROSE_DLL_API Sg##suffix* SageBuilder::build##suffix(SgExpression* op) \
5099 return SageBuilder::buildUnaryExpression<Sg##suffix>(op); \
5102BUILD_UNARY_DEF(AddressOfOp)
5103BUILD_UNARY_DEF(BitComplementOp)
5104BUILD_UNARY_DEF(MinusOp)
5105BUILD_UNARY_DEF(NotOp)
5106BUILD_UNARY_DEF(PointerDerefExp)
5107BUILD_UNARY_DEF(UnaryAddOp)
5108BUILD_UNARY_DEF(AbsOp)
5109BUILD_UNARY_DEF(MinusMinusOp)
5110BUILD_UNARY_DEF(PlusPlusOp)
5111BUILD_UNARY_DEF(RealPartOp)
5112BUILD_UNARY_DEF(ImagPartOp)
5113BUILD_UNARY_DEF(ConjugateOp)
5114BUILD_UNARY_DEF(VarArgStartOneOperandOp)
5115BUILD_UNARY_DEF(VarArgEndOp)
5117BUILD_UNARY_DEF(MatrixTransposeOp)
5119#undef BUILD_UNARY_DEF
5122 SgType * expression_type,
5126 ROSE_ASSERT(result);
5127 if (operand_i) {operand_i->
set_parent(result); markLhsValues(result);}
5138 short int need_global_specifier,
5142 SgNewExp* result =
new SgNewExp(specified_type, placement_args, constructor_args, builtin_args, need_global_specifier, newOperatorDeclaration);
5143 ROSE_ASSERT(result);
5151 short need_global_specifier,
5155 need_global_specifier, deleteOperatorDeclaration);
5156 ROSE_ASSERT(result);
5166 ROSE_ASSERT(result != NULL);
5174 ROSE_ASSERT(result);
5175 if (operand_i) {operand_i->
set_parent(result); markLhsValues(result);}
5182 ROSE_ASSERT(result);
5183 if (operand_i) {operand_i->
set_parent(result); markLhsValues(result);}
5190 SgMinusMinusOp* result = buildUnaryExpression<SgMinusMinusOp>(operand_i);
5191 ROSE_ASSERT(result);
5198 SgMinusMinusOp* result = buildUnaryExpression_nfi<SgMinusMinusOp>(operand_i);
5199 ROSE_ASSERT(result);
5206 SgMinusOp* result = buildUnaryExpression<SgMinusOp>(operand_i);
5207 ROSE_ASSERT(result);
5214 SgMinusOp* result = buildUnaryExpression_nfi<SgMinusOp>(operand_i);
5215 ROSE_ASSERT(result);
5222 SgPlusPlusOp* result = buildUnaryExpression<SgPlusPlusOp>(operand_i);
5223 ROSE_ASSERT(result);
5231 SgPlusPlusOp* result = buildUnaryExpression_nfi<SgPlusPlusOp>(operand_i);
5232 ROSE_ASSERT(result);
5246 markLhsValues(result);
5252 operand_i -> set_parent(result);
5254 ROSE_ASSERT(result);
5261#define BUILD_BINARY_DEF(suffix) \
5262 ROSE_DLL_API Sg##suffix* SageBuilder::build##suffix##_nfi(SgExpression* lhs, SgExpression* rhs) \
5264 return buildBinaryExpression_nfi<Sg##suffix>(lhs, rhs); \
5266 ROSE_DLL_API Sg##suffix* SageBuilder::build##suffix(SgExpression* lhs, SgExpression* rhs) \
5268 return buildBinaryExpression<Sg##suffix>(lhs, rhs); \
5271BUILD_BINARY_DEF(AddOp)
5272BUILD_BINARY_DEF(AndAssignOp)
5273BUILD_BINARY_DEF(AndOp)
5274BUILD_BINARY_DEF(ArrowExp)
5275BUILD_BINARY_DEF(ArrowStarOp)
5276BUILD_BINARY_DEF(AssignOp)
5277BUILD_BINARY_DEF(AtOp)
5278BUILD_BINARY_DEF(BitAndOp)
5279BUILD_BINARY_DEF(BitOrOp)
5280BUILD_BINARY_DEF(BitXorOp)
5282BUILD_BINARY_DEF(CommaOpExp)
5283BUILD_BINARY_DEF(ConcatenationOp)
5284BUILD_BINARY_DEF(DivAssignOp)
5285BUILD_BINARY_DEF(DivideOp)
5286BUILD_BINARY_DEF(DotExp)
5287BUILD_BINARY_DEF(DotStarOp)
5288BUILD_BINARY_DEF(EqualityOp)
5290BUILD_BINARY_DEF(ExponentiationOp)
5291BUILD_BINARY_DEF(ExponentiationAssignOp)
5292BUILD_BINARY_DEF(GreaterOrEqualOp)
5293BUILD_BINARY_DEF(GreaterThanOp)
5294BUILD_BINARY_DEF(IntegerDivideOp)
5295BUILD_BINARY_DEF(IntegerDivideAssignOp)
5296BUILD_BINARY_DEF(IorAssignOp)
5297BUILD_BINARY_DEF(IsOp)
5298BUILD_BINARY_DEF(IsNotOp)
5300BUILD_BINARY_DEF(LessOrEqualOp)
5301BUILD_BINARY_DEF(LessThanOp)
5302BUILD_BINARY_DEF(LshiftAssignOp)
5303BUILD_BINARY_DEF(LshiftOp)
5305BUILD_BINARY_DEF(MembershipOp)
5306BUILD_BINARY_DEF(MinusAssignOp)
5307BUILD_BINARY_DEF(ModAssignOp)
5308BUILD_BINARY_DEF(ModOp)
5309BUILD_BINARY_DEF(MultAssignOp)
5310BUILD_BINARY_DEF(MultiplyOp)
5312BUILD_BINARY_DEF(NotEqualOp)
5313BUILD_BINARY_DEF(NonMembershipOp)
5314BUILD_BINARY_DEF(OrOp)
5315BUILD_BINARY_DEF(PlusAssignOp)
5316BUILD_BINARY_DEF(PntrArrRefExp)
5317BUILD_BINARY_DEF(RemOp)
5318BUILD_BINARY_DEF(RshiftAssignOp)
5319BUILD_BINARY_DEF(JavaUnsignedRshiftAssignOp)
5321BUILD_BINARY_DEF(RshiftOp)
5322BUILD_BINARY_DEF(JavaUnsignedRshiftOp)
5323BUILD_BINARY_DEF(ScopeOp)
5324BUILD_BINARY_DEF(SubtractOp)
5325BUILD_BINARY_DEF(XorAssignOp)
5327BUILD_BINARY_DEF(VarArgCopyOp)
5328BUILD_BINARY_DEF(VarArgStartOp)
5331BUILD_BINARY_DEF(ReplicationOp);
5334BUILD_BINARY_DEF(PowerOp);
5335BUILD_BINARY_DEF(ElementwisePowerOp);
5336BUILD_BINARY_DEF(ElementwiseMultiplyOp);
5337BUILD_BINARY_DEF(ElementwiseDivideOp);
5338BUILD_BINARY_DEF(LeftDivideOp);
5339BUILD_BINARY_DEF(ElementwiseLeftDivideOp);
5340BUILD_BINARY_DEF(ElementwiseAddOp);
5341BUILD_BINARY_DEF(ElementwiseSubtractOp);
5344BUILD_BINARY_DEF(SpaceshipOp)
5346#undef BUILD_BINARY_DEF
5354 ROSE_ASSERT(base_type != NULL);
5358 if (dim_info == NULL)
5369 ROSE_ASSERT(array_type);
5370 ROSE_ASSERT(array_type->get_dim_info() == NULL);
5375 array_type->set_dim_info(dim_info);
5376 array_type->set_rank(dim_info->get_expressions().size());
5384 ASSERT_not_null(result);
5386 if (index !=
nullptr) {
5407 if (a) {a->
set_parent(result); markLhsValues(a);}
5408 if (b) {b->
set_parent(result); markLhsValues(b);}
5416 ROSE_ASSERT(result);
5436 ASSERT_not_null(expr);
5450 ROSE_ASSERT(result);
5451 if (operand_i!=NULL)
5455 markLhsValues(result);
5464 ASSERT_not_null(result);
5469 markLhsValues(result);
5482 ROSE_ASSERT(result);
5483 if (initializers!=NULL)
5487 result->set_need_explicit_braces(
true);
5496 ROSE_ASSERT(result);
5497 if (initializers!=NULL)
5501 result->set_need_explicit_braces(
true);
5510 ROSE_ASSERT(result);
5511 if (initializers!=NULL)
5523 ROSE_ASSERT(result);
5524 if (initializers!=NULL)
5539 bool need_qualifier ,
5540 bool need_parenthesis_after_name ,
5541 bool associated_class_unknown )
5548 ROSE_ASSERT(declaration == NULL || declaration->get_associatedClassDeclaration() != NULL);
5551 need_qualifier, need_parenthesis_after_name, associated_class_unknown );
5552 ROSE_ASSERT(result != NULL);
5571 bool need_qualifier ,
5572 bool need_parenthesis_after_name ,
5573 bool associated_class_unknown )
5579 ROSE_ASSERT(declaration == NULL || declaration->get_associatedClassDeclaration() != NULL);
5582 ROSE_ASSERT(result != NULL);
5607 ROSE_ASSERT(result);
5608 if (initializers!=NULL)
5619 ROSE_ASSERT(result);
5620 if (initializers!=NULL)
5637 ROSE_ASSERT(result);
5641 markLhsValues(result);
5655 ROSE_ASSERT(result);
5659 markLhsValues(result);
5670 ROSE_ASSERT(result);
5680 ROSE_ASSERT(result);
5692 ROSE_ASSERT(result);
5696 markLhsValues(result);
5709 ROSE_ASSERT(result);
5713 markLhsValues(result);