Internals: Rename AstType enum to fix Cygwin define conflict

This commit is contained in:
Wilson Snyder 2010-01-21 18:04:36 -05:00
parent c695af31b8
commit e4f1e5f4c3
5 changed files with 25 additions and 24 deletions

View File

@ -32,7 +32,7 @@
#define ASTNODE_NODE_FUNCS(name,ucname) \
virtual ~Ast ##name() {} \
virtual AstType type() const { return AstType:: ucname; } \
virtual AstType type() const { return AstType::at ##ucname; } \
virtual AstNode* clone() { return new Ast ##name (*this); } \
virtual void accept(AstNVisitor& v, AstNUser* vup=NULL) { v.visit(this,vup); } \
Ast ##name * cloneTree(bool cloneNext) { return AstNode::cloneTree(cloneNext)->cast ##name(); }

View File

@ -1346,7 +1346,7 @@ void EmitCImp::emitCtorImp(AstNodeModule* modp) {
emitCellCtors(modp);
emitSensitives();
emitVarResets(modp);
emitTextSection(AstType::SCCTOR);
emitTextSection(AstType::atSCCTOR);
if (optSystemPerl()) puts("SP_AUTO_CTOR;\n");
puts("}\n");
}
@ -1395,7 +1395,7 @@ void EmitCImp::emitCoverageImp(AstNodeModule* modp) {
void EmitCImp::emitDestructorImp(AstNodeModule* modp) {
puts("\n");
puts(modClassName(modp)+"::~"+modClassName(modp)+"() {\n");
emitTextSection(AstType::SCDTOR);
emitTextSection(AstType::atSCDTOR);
if (modp->isTop()) puts("delete __VlSymsp; __VlSymsp=NULL;\n");
puts("}\n");
}
@ -1622,7 +1622,7 @@ void EmitCImp::emitInt(AstNodeModule* modp) {
}
puts("\n//----------\n\n");
emitTextSection(AstType::SCHDR);
emitTextSection(AstType::atSCHDR);
if (optSystemC() && modp->isTop()) {
puts("SC_MODULE("+modClassName(modp)+") {\n");
@ -1728,7 +1728,7 @@ void EmitCImp::emitInt(AstNodeModule* modp) {
puts("\n// USER METHODS\n");
if (optSystemPerl()) puts("/*AUTOMETHODS*/\n");
emitTextSection(AstType::SCINT);
emitTextSection(AstType::atSCINT);
puts("\n// API METHODS\n");
if (modp->isTop()) {
@ -1791,7 +1791,7 @@ void EmitCImp::emitImp(AstNodeModule* modp) {
puts("SP_MODULE_CONTINUED("+modClassName(modp)+");\n");
}
emitTextSection(AstType::SCIMPHDR);
emitTextSection(AstType::atSCIMPHDR);
if (m_slow && splitFilenum()==0) {
puts("\n//--------------------\n");
@ -1800,7 +1800,7 @@ void EmitCImp::emitImp(AstNodeModule* modp) {
}
if (m_fast && splitFilenum()==0) {
emitTextSection(AstType::SCIMP);
emitTextSection(AstType::atSCIMP);
emitStaticDecl(modp);
}

View File

@ -303,21 +303,21 @@ private:
AstNode* newp = NULL;
// Given a signed/unsigned node type, create the opposite type
switch (nodep->type()) {
case AstType::GT: newp = new AstGtS (nodep->fileline(), lhsp, rhsp); break;
case AstType::GTS: newp = new AstGt (nodep->fileline(), lhsp, rhsp); break;
case AstType::GTE: newp = new AstGteS (nodep->fileline(), lhsp, rhsp); break;
case AstType::GTES: newp = new AstGte (nodep->fileline(), lhsp, rhsp); break;
case AstType::LT: newp = new AstLtS (nodep->fileline(), lhsp, rhsp); break;
case AstType::LTS: newp = new AstLt (nodep->fileline(), lhsp, rhsp); break;
case AstType::LTE: newp = new AstLteS (nodep->fileline(), lhsp, rhsp); break;
case AstType::LTES: newp = new AstLte (nodep->fileline(), lhsp, rhsp); break;
case AstType::DIV: newp = new AstDivS (nodep->fileline(), lhsp, rhsp); break;
case AstType::DIVS: newp = new AstDiv (nodep->fileline(), lhsp, rhsp); break;
case AstType::MODDIV: newp = new AstModDivS(nodep->fileline(), lhsp, rhsp); break;
case AstType::MODDIVS: newp = new AstModDiv (nodep->fileline(), lhsp, rhsp); break;
case AstType::MUL: newp = new AstMulS (nodep->fileline(), lhsp, rhsp); break;
case AstType::MULS: newp = new AstMul (nodep->fileline(), lhsp, rhsp); break;
case AstType::SHIFTRS: newp = new AstShiftR (nodep->fileline(), lhsp, rhsp); break;
case AstType::atGT: newp = new AstGtS (nodep->fileline(), lhsp, rhsp); break;
case AstType::atGTS: newp = new AstGt (nodep->fileline(), lhsp, rhsp); break;
case AstType::atGTE: newp = new AstGteS (nodep->fileline(), lhsp, rhsp); break;
case AstType::atGTES: newp = new AstGte (nodep->fileline(), lhsp, rhsp); break;
case AstType::atLT: newp = new AstLtS (nodep->fileline(), lhsp, rhsp); break;
case AstType::atLTS: newp = new AstLt (nodep->fileline(), lhsp, rhsp); break;
case AstType::atLTE: newp = new AstLteS (nodep->fileline(), lhsp, rhsp); break;
case AstType::atLTES: newp = new AstLte (nodep->fileline(), lhsp, rhsp); break;
case AstType::atDIV: newp = new AstDivS (nodep->fileline(), lhsp, rhsp); break;
case AstType::atDIVS: newp = new AstDiv (nodep->fileline(), lhsp, rhsp); break;
case AstType::atMODDIV: newp = new AstModDivS (nodep->fileline(), lhsp, rhsp); break;
case AstType::atMODDIVS: newp = new AstModDiv (nodep->fileline(), lhsp, rhsp); break;
case AstType::atMUL: newp = new AstMulS (nodep->fileline(), lhsp, rhsp); break;
case AstType::atMULS: newp = new AstMul (nodep->fileline(), lhsp, rhsp); break;
case AstType::atSHIFTRS: newp = new AstShiftR (nodep->fileline(), lhsp, rhsp); break;
default:
nodep->v3fatalSrc("Node needs sign change, but bad case: "<<nodep<<endl);
break;

View File

@ -157,9 +157,10 @@ sub write_types {
my $fh = open_file(@_);
printf $fh " enum en {\n";
# Add "at" prefix to avoid conflicting with FOPEN and other macros in include files
foreach my $type (sort (keys %Classes)) {
next if $type =~ /^Node/;
print $fh "\t",uc $type,",\n";
print $fh "\tat",uc $type,",\n";
}
printf $fh "\t_ENUM_END\n";
printf $fh " };\n";

View File

@ -48,7 +48,7 @@ novcs:
vcs: vcs_passed.log
simv: $(V_FILES) ../test_v/input.vc
vcs +cli -I +define+vcs+1 -f ../test_v/input.vc -q bench.v
vcs +cli -I -sverilog +define+VCS+1 -f ../test_v/input.vc -q bench.v
vcs_passed.log : simv
-rm -f test_passed.log