charmxi: Move meaning from comments to function names
authorPhil Miller <mille121@illinois.edu>
Fri, 12 Oct 2012 19:20:05 +0000 (14:20 -0500)
committerPhil Miller <mille121@illinois.edu>
Fri, 12 Oct 2012 19:21:48 +0000 (14:21 -0500)
src/xlat-i/xi-symbol.C
src/xlat-i/xi-symbol.h

index c29458981e7d7a609a01ab9be4881dc464104af9..983ad79a6c674b89fee9b2b7b0c0cdb38c80e5cf 100644 (file)
@@ -4190,7 +4190,7 @@ void Entry::genDecls(XStr& str)
     die("Entry methods must specify a return type-- \n"
         "use void if necessary",line);
 
-  if (attribs&SMIGRATE)
+  if (isMigrationConstructor())
     {} //User cannot call the migration constructor
   else if(container->isGroup()) {
     genGroupDecl(str);
@@ -4458,7 +4458,7 @@ void Entry::genDefs(XStr& str)
   templateGuardBegin(tspec || container->isTemplated(), str);
   str << "/* DEFS: "; print(str); str << " */\n";
 
-  if (attribs&SMIGRATE)
+  if(isMigrationConstructor())
     {} //User cannot call the migration constructor
   else if(container->isGroup()){
     genGroupDefs(str);
@@ -4501,7 +4501,7 @@ void Entry::genDefs(XStr& str)
     str << "\n  CkRegisterMessagePupFn(epidx, "
         << "_marshallmessagepup_" << epStr(false, true) << ");\n";
   }
-  else if (param->isMessage() && !attribs&SMIGRATE) {
+  else if (param->isMessage() && !isMigrationConstructor()) {
     str << "\n  CkRegisterMessagePupFn(epidx, (CkMessagePupFn)"
         << param->param->getType()->getBaseName() << "::ckDebugPup);";
   }
@@ -4678,7 +4678,7 @@ XStr Entry::genRegEp(bool isForRedn)
   if (param->isMarshalled()) {
     if (param->hasConditional())  str<<"MarshallMsg_"<<epStr()<<"::__idx";
     else str<<"CkMarshallMsg::__idx";
-  } else if(!param->isVoid() && !(attribs&SMIGRATE)) {
+  } else if(!param->isVoid() && !isMigrationConstructor()) {
     param->genMsgProxyName(str);
     str <<"::__idx";
   } else if (isForRedn) {
@@ -4725,11 +4725,11 @@ void Entry::genReg(XStr& str)
   if (isReductionTarget())
     str << "  " << epIdx(0, true) << ";\n";
   if (isConstructor()) {
-    if(container->isMainChare()&&!(attribs&SMIGRATE))
+    if(container->isMainChare() && !isMigrationConstructor())
       str << "  CkRegisterMainChare(__idx, "<<epIdx(0)<<");\n";
     if(param->isVoid())
       str << "  CkRegisterDefaultCtor(__idx, "<<epIdx(0)<<");\n";
-    if(attribs&SMIGRATE)
+    if(isMigrationConstructor())
       str << "  CkRegisterMigCtor(__idx, "<<epIdx(0)<<");\n";
   }
 }
index e832fcb0c6c2049b1f2e11c41ff4850e13e98b61..1baf19a160ca3423ec4955c9c9b8065049b0d68e 100644 (file)
@@ -1026,6 +1026,7 @@ class Entry : public Member {
     int isSync(void) { return (attribs & SSYNC); }
     int isIget(void) { return (attribs & SIGET); }
     int isConstructor(void) { return !strcmp(name, container->baseName(0).get_string());}
+    bool isMigrationConstructor() { return isConstructor() && (attribs & SMIGRATE); }
     int isExclusive(void) { return (attribs & SLOCKED); }
     int isImmediate(void) { return (attribs & SIMMEDIATE); }
     int isSkipscheduler(void) { return (attribs & SSKIPSCHED); }