2012-04-13 01:08:20 +00:00
|
|
|
|
// -*- mode: C++; c-file-style: "cc-mode" -*-
|
2006-08-26 11:35:28 +00:00
|
|
|
|
//*************************************************************************
|
|
|
|
|
// DESCRIPTION: Verilator: Symbol table
|
|
|
|
|
//
|
2008-04-25 12:14:27 +00:00
|
|
|
|
// Code available from: http://www.veripool.org/verilator
|
2006-08-26 11:35:28 +00:00
|
|
|
|
//
|
|
|
|
|
//*************************************************************************
|
|
|
|
|
//
|
2018-01-02 23:05:06 +00:00
|
|
|
|
// Copyright 2003-2018 by Wilson Snyder. This program is free software; you can
|
2006-08-26 11:35:28 +00:00
|
|
|
|
// redistribute it and/or modify it under the terms of either the GNU
|
2009-05-04 21:07:57 +00:00
|
|
|
|
// Lesser General Public License Version 3 or the Perl Artistic License
|
|
|
|
|
// Version 2.0.
|
2006-08-26 11:35:28 +00:00
|
|
|
|
//
|
|
|
|
|
// Verilator is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
//*************************************************************************
|
|
|
|
|
|
|
|
|
|
#ifndef _V3LINKSYMTABLE_H_
|
|
|
|
|
#define _V3LINKSYMTABLE_H_ 1
|
|
|
|
|
|
2006-12-18 19:20:45 +00:00
|
|
|
|
#include "config_build.h"
|
|
|
|
|
#include "verilatedos.h"
|
2008-06-30 17:11:25 +00:00
|
|
|
|
#include <cstdio>
|
|
|
|
|
#include <cstdarg>
|
2006-08-26 11:35:28 +00:00
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#include <map>
|
2009-11-07 04:16:06 +00:00
|
|
|
|
#include <iomanip>
|
2012-06-20 10:13:28 +00:00
|
|
|
|
#include <memory>
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
|
|
#include "V3Global.h"
|
2011-11-30 03:09:50 +00:00
|
|
|
|
#include "V3Ast.h"
|
2012-06-20 10:13:28 +00:00
|
|
|
|
#include "V3File.h"
|
|
|
|
|
|
|
|
|
|
class VSymGraph;
|
2012-07-18 01:29:10 +00:00
|
|
|
|
class VSymEnt;
|
2006-08-26 11:35:28 +00:00
|
|
|
|
|
|
|
|
|
//######################################################################
|
|
|
|
|
// Symbol table
|
|
|
|
|
|
2012-07-18 01:29:10 +00:00
|
|
|
|
typedef set<VSymEnt*> VSymMap;
|
2017-09-21 01:04:59 +00:00
|
|
|
|
typedef set<const VSymEnt*> VSymConstMap;
|
2012-07-18 01:29:10 +00:00
|
|
|
|
|
2012-06-20 10:13:28 +00:00
|
|
|
|
class VSymEnt {
|
2006-08-26 11:35:28 +00:00
|
|
|
|
// Symbol table that can have a "superior" table for resolving upper references
|
2012-06-20 10:13:28 +00:00
|
|
|
|
private:
|
2006-08-26 11:35:28 +00:00
|
|
|
|
// MEMBERS
|
2012-07-18 01:29:10 +00:00
|
|
|
|
typedef std::multimap<string,VSymEnt*> IdNameMap;
|
2009-10-31 14:14:04 +00:00
|
|
|
|
IdNameMap m_idNameMap; // Hash of variables by name
|
2012-06-20 10:13:28 +00:00
|
|
|
|
AstNode* m_nodep; // Node that entry belongs to
|
|
|
|
|
VSymEnt* m_fallbackp; // Table "above" this one in name scope, for fallback resolution
|
|
|
|
|
VSymEnt* m_parentp; // Table that created this table, dot notation needed to resolve into it
|
2012-07-18 01:29:10 +00:00
|
|
|
|
AstPackage* m_packagep; // Package node is in (for V3LinkDot, unused here)
|
2012-06-20 10:13:28 +00:00
|
|
|
|
string m_symPrefix; // String to prefix symbols with (for V3LinkDot, unused here)
|
2012-12-18 01:26:40 +00:00
|
|
|
|
bool m_exported; // Allow importing
|
|
|
|
|
bool m_imported; // Was imported
|
2012-08-16 01:28:30 +00:00
|
|
|
|
#ifdef VL_DEBUG
|
2012-07-21 13:27:57 +00:00
|
|
|
|
static int debug() {
|
|
|
|
|
static int level = -1;
|
|
|
|
|
if (VL_UNLIKELY(level < 0)) level = v3Global.opt.debugSrcLevel("V3LinkDot.cpp");
|
|
|
|
|
return level;
|
|
|
|
|
}
|
|
|
|
|
#else
|
2012-11-03 12:01:19 +00:00
|
|
|
|
static inline int debug() { return 0; } // NOT runtime, too hot of a function
|
2012-07-21 13:27:57 +00:00
|
|
|
|
#endif
|
2012-07-18 01:29:10 +00:00
|
|
|
|
public:
|
2017-09-21 01:04:59 +00:00
|
|
|
|
void dumpIterate(ostream& os, VSymConstMap& doneSymsr, const string& indent, int numLevels, const string& searchName) const {
|
2012-07-18 01:29:10 +00:00
|
|
|
|
os<<indent<<"+ "<<left<<setw(30)<<(searchName==""?"\"\"":searchName)<<setw(0)<<right;
|
2012-07-20 01:18:39 +00:00
|
|
|
|
os<<" se"<<(void*)(this)<<setw(0);
|
|
|
|
|
os<<" fallb=se"<<(void*)(m_fallbackp);
|
2012-06-20 10:13:28 +00:00
|
|
|
|
os<<" n="<<nodep();
|
|
|
|
|
os<<endl;
|
2012-07-18 01:29:10 +00:00
|
|
|
|
if (doneSymsr.find(this) != doneSymsr.end()) {
|
|
|
|
|
os<<indent<<"| ^ duplicate, so no children printed\n";
|
|
|
|
|
} else {
|
|
|
|
|
doneSymsr.insert(this);
|
|
|
|
|
for (IdNameMap::const_iterator it=m_idNameMap.begin(); it!=m_idNameMap.end(); ++it) {
|
|
|
|
|
if (numLevels >= 1) {
|
|
|
|
|
it->second->dumpIterate(os, doneSymsr, indent+"| ", numLevels-1, it->first);
|
|
|
|
|
}
|
2012-06-20 10:13:28 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-09-21 01:04:59 +00:00
|
|
|
|
void dump(ostream& os, const string& indent="", int numLevels=1) const {
|
|
|
|
|
VSymConstMap doneSyms;
|
2012-07-18 01:29:10 +00:00
|
|
|
|
dumpIterate(os, doneSyms, indent, numLevels, "TOP");
|
|
|
|
|
}
|
2012-06-20 10:13:28 +00:00
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
|
// METHODS
|
2012-12-18 01:26:40 +00:00
|
|
|
|
VSymEnt(VSymGraph* graphp, const VSymEnt* symp); // Below
|
2012-06-20 10:13:28 +00:00
|
|
|
|
VSymEnt(VSymGraph* graphp, AstNode* nodep); // Below
|
2012-08-16 01:28:30 +00:00
|
|
|
|
~VSymEnt() {
|
|
|
|
|
// Change links so we coredump if used
|
|
|
|
|
#ifdef VL_DEBUG
|
|
|
|
|
m_nodep = (AstNode*)1;
|
|
|
|
|
m_fallbackp = (VSymEnt*)1;
|
|
|
|
|
m_parentp = (VSymEnt*)1;
|
|
|
|
|
m_packagep = (AstPackage*)1;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
#if defined(VL_DEBUG) && !defined(VL_LEAK_CHECKS)
|
|
|
|
|
void operator delete(void* objp, size_t size) {} // For testing, leak so above destructor 1 assignments work
|
|
|
|
|
#endif
|
2012-06-20 10:13:28 +00:00
|
|
|
|
void fallbackp(VSymEnt* entp) { m_fallbackp = entp; }
|
|
|
|
|
void parentp(VSymEnt* entp) { m_parentp = entp; }
|
|
|
|
|
VSymEnt* parentp() const { return m_parentp; }
|
2012-07-18 01:29:10 +00:00
|
|
|
|
void packagep(AstPackage* entp) { m_packagep = entp; }
|
|
|
|
|
AstPackage* packagep() const { return m_packagep; }
|
2016-02-03 02:02:00 +00:00
|
|
|
|
AstNode* nodep() const { return m_nodep; }
|
2012-06-20 10:13:28 +00:00
|
|
|
|
string symPrefix() const { return m_symPrefix; }
|
|
|
|
|
void symPrefix(const string& name) { m_symPrefix = name; }
|
2012-12-18 01:26:40 +00:00
|
|
|
|
bool exported() const { return m_exported; }
|
|
|
|
|
void exported(bool flag) { m_exported = flag; }
|
|
|
|
|
bool imported() const { return m_imported; }
|
|
|
|
|
void imported(bool flag) { m_imported = flag; }
|
2012-06-20 10:13:28 +00:00
|
|
|
|
void insert(const string& name, VSymEnt* entp) {
|
2012-07-20 01:18:39 +00:00
|
|
|
|
UINFO(9, " SymInsert se"<<(void*)this<<" '"<<name<<"' se"<<(void*)entp<<" "<<entp->nodep()<<endl);
|
2012-07-18 01:29:10 +00:00
|
|
|
|
if (name != "" && m_idNameMap.find(name) != m_idNameMap.end()) {
|
2006-08-26 11:35:28 +00:00
|
|
|
|
if (!V3Error::errorCount()) { // Else may have just reported warning
|
2012-06-20 10:13:28 +00:00
|
|
|
|
if (debug()>=9 || V3Error::debugDefault()) dump(cout,"- err-dump: ", 1);
|
|
|
|
|
entp->nodep()->v3fatalSrc("Inserting two symbols with same name: "<<name<<endl);
|
2006-08-26 11:35:28 +00:00
|
|
|
|
}
|
|
|
|
|
} else {
|
2012-06-20 10:13:28 +00:00
|
|
|
|
m_idNameMap.insert(make_pair(name, entp));
|
2006-08-26 11:35:28 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2012-06-20 10:13:28 +00:00
|
|
|
|
void reinsert(const string& name, VSymEnt* entp) {
|
2009-10-31 14:14:04 +00:00
|
|
|
|
IdNameMap::iterator it = m_idNameMap.find(name);
|
2012-07-18 01:29:10 +00:00
|
|
|
|
if (name!="" && it != m_idNameMap.end()) {
|
2012-07-20 01:18:39 +00:00
|
|
|
|
UINFO(9, " SymReinsert se"<<(void*)this<<" '"<<name<<"' se"<<(void*)entp<<" "<<entp->nodep()<<endl);
|
2012-06-20 10:13:28 +00:00
|
|
|
|
it->second = entp; // Replace
|
2009-10-31 14:14:04 +00:00
|
|
|
|
} else {
|
2012-06-20 10:13:28 +00:00
|
|
|
|
insert(name,entp);
|
2009-10-31 14:14:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2012-06-20 10:13:28 +00:00
|
|
|
|
VSymEnt* findIdFlat(const string& name) const {
|
2009-03-24 13:22:58 +00:00
|
|
|
|
// Find identifier without looking upward through symbol hierarchy
|
2006-08-26 11:35:28 +00:00
|
|
|
|
// First, scan this begin/end block or module for the name
|
2013-05-18 23:45:40 +00:00
|
|
|
|
IdNameMap::const_iterator it = m_idNameMap.find(name);
|
2012-07-20 01:18:39 +00:00
|
|
|
|
UINFO(9, " SymFind se"<<(void*)this<<" '"<<name
|
2013-05-18 23:45:40 +00:00
|
|
|
|
<<"' -> "<<(it == m_idNameMap.end() ? "NONE"
|
|
|
|
|
: "se"+cvtToStr((void*)(it->second))+" n="+cvtToStr((void*)(it->second->nodep())))<<endl);
|
|
|
|
|
if (it != m_idNameMap.end()) return (it->second);
|
2009-03-23 18:57:15 +00:00
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2012-06-20 10:13:28 +00:00
|
|
|
|
VSymEnt* findIdFallback(const string& name) const {
|
2009-03-24 13:22:58 +00:00
|
|
|
|
// Find identifier looking upward through symbol hierarchy
|
2009-03-23 18:57:15 +00:00
|
|
|
|
// First, scan this begin/end block or module for the name
|
2012-06-20 10:13:28 +00:00
|
|
|
|
if (VSymEnt* entp = findIdFlat(name)) return entp;
|
2006-08-26 11:35:28 +00:00
|
|
|
|
// Then scan the upper begin/end block or module for the name
|
2012-06-20 10:09:07 +00:00
|
|
|
|
if (m_fallbackp) return m_fallbackp->findIdFallback(name);
|
2006-08-26 11:35:28 +00:00
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2013-01-09 00:06:52 +00:00
|
|
|
|
private:
|
2017-09-21 01:04:59 +00:00
|
|
|
|
void importOneSymbol(VSymGraph* graphp, const string& name, const VSymEnt* srcp) {
|
2013-01-09 00:06:52 +00:00
|
|
|
|
if (srcp->exported()
|
|
|
|
|
&& !findIdFlat(name)) { // Don't insert over existing entry
|
|
|
|
|
VSymEnt* symp = new VSymEnt(graphp, srcp);
|
|
|
|
|
symp->exported(false); // Can't reimport an import without an export
|
|
|
|
|
symp->imported(true);
|
|
|
|
|
reinsert(name, symp);
|
2017-09-21 01:04:59 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void exportOneSymbol(VSymGraph* graphp, const string& name, const VSymEnt* srcp) {
|
|
|
|
|
if (srcp->exported()) {
|
|
|
|
|
if (VSymEnt* symp = findIdFlat(name)) { // Should already exist in current table
|
|
|
|
|
if (!symp->exported()) symp->exported(true);
|
|
|
|
|
}
|
2013-01-09 00:06:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public:
|
2017-09-21 01:04:59 +00:00
|
|
|
|
void importFromPackage(VSymGraph* graphp, const VSymEnt* srcp, const string& id_or_star) {
|
2009-11-10 00:07:59 +00:00
|
|
|
|
// Import tokens from source symbol table into this symbol table
|
|
|
|
|
if (id_or_star != "*") {
|
|
|
|
|
IdNameMap::const_iterator it = srcp->m_idNameMap.find(id_or_star);
|
2017-09-21 01:04:59 +00:00
|
|
|
|
if (it != srcp->m_idNameMap.end()) {
|
2013-01-09 00:06:52 +00:00
|
|
|
|
importOneSymbol(graphp, it->first, it->second);
|
2009-11-10 00:07:59 +00:00
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
for (IdNameMap::const_iterator it=srcp->m_idNameMap.begin(); it!=srcp->m_idNameMap.end(); ++it) {
|
2017-09-21 01:04:59 +00:00
|
|
|
|
importOneSymbol(graphp, it->first, it->second);
|
2009-11-10 00:07:59 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-09-21 01:04:59 +00:00
|
|
|
|
}
|
|
|
|
|
void exportFromPackage(VSymGraph* graphp, const VSymEnt* srcp, const string& id_or_star) {
|
|
|
|
|
// Export tokens from source symbol table into this symbol table
|
|
|
|
|
if (id_or_star != "*") {
|
|
|
|
|
IdNameMap::const_iterator it = srcp->m_idNameMap.find(id_or_star);
|
|
|
|
|
if (it != srcp->m_idNameMap.end()) {
|
|
|
|
|
exportOneSymbol(graphp, it->first, it->second);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
for (IdNameMap::const_iterator it=srcp->m_idNameMap.begin(); it!=srcp->m_idNameMap.end(); ++it) {
|
|
|
|
|
exportOneSymbol(graphp, it->first, it->second);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void exportStarStar(VSymGraph* graphp) {
|
|
|
|
|
// Export *:*: Export all tokens from imported packages
|
|
|
|
|
for (IdNameMap::const_iterator it=m_idNameMap.begin(); it!=m_idNameMap.end(); ++it) {
|
|
|
|
|
VSymEnt* symp = it->second;
|
|
|
|
|
if (!symp->exported()) symp->exported(true);
|
|
|
|
|
}
|
2009-11-10 00:07:59 +00:00
|
|
|
|
}
|
2017-05-10 23:05:42 +00:00
|
|
|
|
void importFromIface(VSymGraph* graphp, const VSymEnt* srcp, bool onlyUnmodportable = false) {
|
2013-05-28 01:39:19 +00:00
|
|
|
|
// Import interface tokens from source symbol table into this symbol table, recursively
|
|
|
|
|
UINFO(9, " importIf se"<<(void*)this<<" from se"<<(void*)srcp<<endl);
|
|
|
|
|
for (IdNameMap::const_iterator it=srcp->m_idNameMap.begin(); it!=srcp->m_idNameMap.end(); ++it) {
|
|
|
|
|
const string& name = it->first;
|
2014-04-04 01:53:39 +00:00
|
|
|
|
VSymEnt* subSrcp = it->second;
|
2017-05-10 23:05:42 +00:00
|
|
|
|
AstVar* varp = subSrcp->nodep()->castVar();
|
|
|
|
|
if (!onlyUnmodportable || (varp && varp->varType() == AstVarType::GPARAM)) {
|
|
|
|
|
VSymEnt* subSymp = new VSymEnt(graphp, subSrcp);
|
|
|
|
|
reinsert(name, subSymp);
|
|
|
|
|
// And recurse to create children
|
|
|
|
|
subSymp->importFromIface(graphp, subSrcp);
|
|
|
|
|
}
|
2013-05-28 01:39:19 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2012-07-23 02:48:39 +00:00
|
|
|
|
void cellErrorScopes(AstNode* lookp, string prettyName="") {
|
|
|
|
|
if (prettyName=="") prettyName = lookp->prettyName();
|
2012-06-20 10:13:28 +00:00
|
|
|
|
string scopes;
|
|
|
|
|
for (IdNameMap::iterator it = m_idNameMap.begin(); it!=m_idNameMap.end(); ++it) {
|
|
|
|
|
AstNode* nodep = it->second->nodep();
|
|
|
|
|
if (nodep->castCell()
|
|
|
|
|
|| (nodep->castModule() && nodep->castModule()->isTop())) {
|
|
|
|
|
if (scopes != "") scopes += ", ";
|
|
|
|
|
scopes += AstNode::prettyName(it->first);
|
2009-10-31 14:14:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2012-07-20 01:18:39 +00:00
|
|
|
|
if (scopes=="") scopes="<no cells found>";
|
2012-07-23 02:48:39 +00:00
|
|
|
|
cerr<<V3Error::msgPrefix()<<" Known scopes under '"<<prettyName<<"': "
|
2012-06-20 10:13:28 +00:00
|
|
|
|
<<scopes<<endl;
|
|
|
|
|
if (debug()) dump(cerr,"\t\t KnownScope: ", 1);
|
|
|
|
|
}
|
2006-08-26 11:35:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
2012-06-20 10:13:28 +00:00
|
|
|
|
//######################################################################
|
|
|
|
|
// Symbol tables
|
|
|
|
|
|
|
|
|
|
class VSymGraph {
|
|
|
|
|
// Collection of symbol tables
|
|
|
|
|
// TYPES
|
|
|
|
|
typedef vector<VSymEnt*> SymStack;
|
|
|
|
|
|
|
|
|
|
// MEMBERS
|
|
|
|
|
VSymEnt* m_symRootp; // Root symbol table
|
|
|
|
|
SymStack m_symsp; // All symbol tables, to cleanup
|
|
|
|
|
|
2017-11-01 22:51:41 +00:00
|
|
|
|
// CONSTRUCTORS
|
|
|
|
|
VL_UNCOPYABLE(VSymGraph);
|
|
|
|
|
public:
|
|
|
|
|
explicit VSymGraph(AstNetlist* nodep) {
|
|
|
|
|
m_symRootp = new VSymEnt(this, nodep);
|
|
|
|
|
}
|
|
|
|
|
~VSymGraph() {
|
|
|
|
|
for (SymStack::iterator it = m_symsp.begin(); it != m_symsp.end(); ++it) {
|
|
|
|
|
delete (*it);
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-06-20 10:13:28 +00:00
|
|
|
|
|
|
|
|
|
public:
|
2017-11-01 22:51:41 +00:00
|
|
|
|
// METHODS
|
2012-06-20 10:13:28 +00:00
|
|
|
|
VSymEnt* rootp() const { return m_symRootp; }
|
|
|
|
|
// Debug
|
|
|
|
|
void dump(ostream& os, const string& indent="") {
|
2017-09-21 01:04:59 +00:00
|
|
|
|
VSymConstMap doneSyms;
|
2012-06-20 10:13:28 +00:00
|
|
|
|
os<<"SymEnt Dump:\n";
|
2012-07-20 01:18:39 +00:00
|
|
|
|
m_symRootp->dumpIterate(os, doneSyms, indent, 9999, "$root");
|
2013-02-03 18:27:37 +00:00
|
|
|
|
bool first = true;
|
2012-07-18 01:29:10 +00:00
|
|
|
|
for (SymStack::iterator it = m_symsp.begin(); it != m_symsp.end(); ++it) {
|
|
|
|
|
if (doneSyms.find(*it) == doneSyms.end()) {
|
2013-02-03 18:27:37 +00:00
|
|
|
|
if (first) { first=false; os<<"%%Warning: SymEnt Orphans:\n"; }
|
2012-07-18 01:29:10 +00:00
|
|
|
|
(*it)->dumpIterate(os, doneSyms, indent, 9999, "Orphan");
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-06-20 10:13:28 +00:00
|
|
|
|
}
|
|
|
|
|
void dumpFilePrefixed(const string& nameComment) {
|
|
|
|
|
if (v3Global.opt.dumpTree()) {
|
|
|
|
|
string filename = v3Global.debugFilename(nameComment)+".txt";
|
2012-07-20 01:18:39 +00:00
|
|
|
|
UINFO(2,"Dumping "<<filename<<endl);
|
2017-10-18 22:22:58 +00:00
|
|
|
|
const vl_unique_ptr<ofstream> logp (V3File::new_ofstream(filename));
|
2012-06-20 10:13:28 +00:00
|
|
|
|
if (logp->fail()) v3fatalSrc("Can't write "<<filename);
|
|
|
|
|
dump(*logp, "");
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-11-01 22:51:41 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
friend class VSymEnt;
|
|
|
|
|
void pushNewEnt(VSymEnt* entp) { m_symsp.push_back(entp); }
|
2012-06-20 10:13:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//######################################################################
|
|
|
|
|
|
2012-12-18 01:26:40 +00:00
|
|
|
|
inline VSymEnt::VSymEnt(VSymGraph* graphp, AstNode* nodep)
|
2012-06-20 10:13:28 +00:00
|
|
|
|
: m_nodep(nodep) {
|
|
|
|
|
// No argument to set fallbackp, as generally it's wrong to set it in the new call,
|
|
|
|
|
// Instead it needs to be set on a "findOrNew()" return, as it may have been new'ed
|
|
|
|
|
// by an earlier search insertion.
|
|
|
|
|
m_fallbackp = NULL;
|
|
|
|
|
m_parentp = NULL;
|
2012-07-18 01:29:10 +00:00
|
|
|
|
m_packagep = NULL;
|
2012-12-18 01:26:40 +00:00
|
|
|
|
m_exported = true;
|
|
|
|
|
m_imported = false;
|
|
|
|
|
graphp->pushNewEnt(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline VSymEnt::VSymEnt(VSymGraph* graphp, const VSymEnt* symp)
|
2016-02-03 02:02:00 +00:00
|
|
|
|
: m_nodep(symp->m_nodep) {
|
2012-12-18 01:26:40 +00:00
|
|
|
|
m_fallbackp = symp->m_fallbackp;
|
|
|
|
|
m_parentp = symp->m_parentp;
|
|
|
|
|
m_packagep = symp->m_packagep;
|
|
|
|
|
m_exported = symp->m_exported;
|
|
|
|
|
m_imported = symp->m_imported;
|
|
|
|
|
graphp->pushNewEnt(this);
|
2012-06-20 10:13:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-08-26 11:35:28 +00:00
|
|
|
|
#endif // guard
|