Internals: Add CCall assertion

This commit is contained in:
Wilson Snyder 2025-09-07 17:18:23 -04:00
parent 72acb2edfd
commit e60f52ee0c
3 changed files with 8 additions and 8 deletions

View File

@ -4512,7 +4512,9 @@ class AstCCall final : public AstNodeCCall {
// pointer (e.g.: 'this')
public:
AstCCall(FileLine* fl, AstCFunc* funcp, AstNodeExpr* argsp = nullptr)
: ASTGEN_SUPER_CCall(fl, funcp, argsp) {}
: ASTGEN_SUPER_CCall(fl, funcp, argsp) {
UASSERT_OBJ(funcp, this, "CCall created calling null function");
}
ASTGEN_MEMBERS_AstCCall;
const VSelfPointerText& selfPointer() const { return m_selfPointer; }
@ -4528,6 +4530,7 @@ public:
AstCMethodCall(FileLine* fl, AstNodeExpr* fromp, AstCFunc* funcp, AstNodeExpr* argsp = nullptr)
: ASTGEN_SUPER_CMethodCall(fl, funcp, argsp) {
this->fromp(fromp);
UASSERT_OBJ(funcp, this, "CMethodCall created calling null function");
}
ASTGEN_MEMBERS_AstCMethodCall;
};

View File

@ -33,9 +33,8 @@
class V3DfgContext;
//////////////////////////////////////////////////////////////////////////////
//######################################################################
// Base class for all context objects
//////////////////////////////////////////////////////////////////////////////
class V3DfgSubContext VL_NOT_FINAL {
V3DfgContext& m_ctx; // The whole context
@ -59,9 +58,8 @@ public:
const std::string& label() const { return m_label; }
};
//////////////////////////////////////////////////////////////////////////////
//######################################################################
// Contexts for various algorithms - keep sorted
//////////////////////////////////////////////////////////////////////////////
class V3DfgAstToDfgContext final : public V3DfgSubContext {
// Only V3DfgContext can create an instance
@ -334,9 +332,8 @@ private:
}
};
//////////////////////////////////////////////////////////////////////////////
//######################################################################
// Top level V3DfgContext
//////////////////////////////////////////////////////////////////////////////
class V3DfgContext final {
const std::string m_label; // Label to add to stats, etc.

View File

@ -127,7 +127,7 @@ string EmitCBaseVisitorConst::cFuncArgs(const AstCFunc* nodep) {
for (const AstNode* stmtp = nodep->argsp(); stmtp; stmtp = stmtp->nextp()) {
if (const AstVar* const portp = VN_CAST(stmtp, Var)) {
if (portp->isIO() && !portp->isFuncReturn()) {
if (args != "") args += ", ";
if (!args.empty()) args += ", ";
if (nodep->dpiImportPrototype() || nodep->dpiExportDispatcher()) {
args += portp->dpiArgType(true, false);
} else if (nodep->funcPublic()) {