charmxi: Error on attempts to write SDAG in constructors
authorPhil Miller <mille121@illinois.edu>
Fri, 21 Sep 2012 18:50:19 +0000 (13:50 -0500)
committerPhil Miller <mille121@illinois.edu>
Fri, 21 Sep 2012 18:50:36 +0000 (13:50 -0500)
src/xlat-i/sdag/CSdagConstruct.C
src/xlat-i/xi-symbol.h

index ad2017c469c8356eff4b11e5a5d21dffbcbe7696..9f8111f9e9c13c16c7f7120b35c0c4beda82a2a4 100644 (file)
@@ -1114,6 +1114,12 @@ void SdagConstruct::generateSlist(XStr& decls, XStr& defs, Entry* entry)
 
 void SdagConstruct::generateSdagEntry(XStr& decls, XStr& defs, Entry *entry)
 {
+  if (entry->isConstructor()) {
+    std::cerr << cur_file << ":" << entry->getLine()
+              << ": Chare constructor cannot be defined with SDAG code" << std::endl;
+    exit(1);
+  }
+
   decls << "public:\n";
   generateSignature(decls, defs, entry, false, "void", con1->text, false, stateVars);
   SdagConstruct *sc;
index e53d53eecad254f9d20500c4be878ce8f50bbd13..fe6cbd69f9a672596e62b967b200c854c19ca276 100644 (file)
@@ -1043,6 +1043,7 @@ class Entry : public Member {
     void collectSdagCode(CParsedFile *pf, int& sdagPresent);
     void propagateState(int);
     void lookforCEntry(CEntry *centry);
+    int getLine() { return line; }
 };
 
 class EntryList {