@@ -68,7 +68,7 @@ shared_ptr<CodeScope> ScTraverseProc::getScopeForBlock(AdjBlock block, unsigned
68
68
llvm::Optional<std::string>
69
69
ScTraverseProc::getSvaInLoopStr (const std::string& svaStr, bool isResetSection)
70
70
{
71
- std::string tabStr = (isResetSection ? " " : " " ) ;
71
+ std::string tabStr = " " ;
72
72
std::string loopStr;
73
73
74
74
for (auto i = loopStack.begin (); i != loopStack.end (); ++i) {
@@ -126,15 +126,22 @@ void ScTraverseProc::getTermCondValue(const Stmt* stmt, SValue& val, SValue& fva
126
126
i = termConds.find (callStack);
127
127
bool firstIter = (i != termConds.end ());
128
128
fval = firstIter ? i->second : NO_VALUE;
129
+
130
+ // cout << "Call stack first iter " << hex;
131
+ // for (auto i : callStack) cout << " " << i;
132
+ // cout << " fval " << fval << endl;
129
133
130
- if (firstIter && otherIters) {
134
+ if (firstIter && otherIters) {
131
135
// Join first iteration value to all other iterations value
132
136
if (val != fval) val = NO_VALUE;
133
137
} else
134
138
if (firstIter && !otherIters) {
135
139
// If there is only one loop iteration
136
140
val = fval;
137
141
}
142
+
143
+ // cout << "getTermConds " << hex << stmt << " stackSize " << callStack.size()
144
+ // << " val " << val << dec << endl;
138
145
// cout << "First iter " << fval.asString() << " " << firstIter
139
146
// << ", other iters " << val.asString() << " " << otherIters << endl;
140
147
}
@@ -386,7 +393,7 @@ void ScTraverseProc::parseMemberCall(CXXMemberCallExpr* expr, SValue& tval,
386
393
387
394
} else
388
395
if (isConstCharPtr (expr->getType ())) {
389
- // Do nothing, all logic implemented in ScParseExprValue
396
+ // Do nothing, all logic implemented in ScGenerateExpr
390
397
391
398
} else
392
399
if ( isAnyScCoreObject (thisType) ) {
@@ -400,6 +407,9 @@ void ScTraverseProc::parseMemberCall(CXXMemberCallExpr* expr, SValue& tval,
400
407
} else {
401
408
// Do nothing for other @sc_core methods
402
409
}
410
+ } else
411
+ if (codeWriter->isParseSvaArg ()) {
412
+ // Do nothing for function call in SVA, all done in ScGenerateExpr
403
413
404
414
} else {
405
415
// General method call
@@ -425,12 +435,6 @@ void ScTraverseProc::parseMemberCall(CXXMemberCallExpr* expr, SValue& tval,
425
435
}
426
436
427
437
} else {
428
- // Normal processing of function call
429
- if (codeWriter->isParseSvaArg ()) {
430
- ScDiag::reportScDiag (expr->getBeginLoc (),
431
- ScDiag::SYNTH_FUNC_IN_ASSERT);
432
- }
433
-
434
438
// Declare temporal variable if it is not a pointer
435
439
if (!isVoidType (retType) && !isPointer (retType)) {
436
440
codeWriter->putVarDecl (nullptr , retVal, retType, nullptr , false ,
@@ -857,7 +861,8 @@ void ScTraverseProc::run()
857
861
if (auto superStmtLevel = stmtInfo.getLevel (superStmt)) {
858
862
level = *superStmtLevel;
859
863
isCallSubStmt = isUserCallExpr (currStmt);
860
- isStmt = isCallSubStmt && !isIoStreamStmt (superStmt);
864
+ isStmt = isCallSubStmt && !isIoStreamStmt (superStmt) &&
865
+ !codeWriter->isParseSvaArg ();
861
866
}
862
867
// cout << hex << "getSubStmtLevel " << currStmt << endl;
863
868
0 commit comments