diff --git a/internals.pod b/internals.pod index bd2e3fbca..7657eaeb1 100644 --- a/internals.pod +++ b/internals.pod @@ -237,10 +237,10 @@ implementation is not found, the system will look in turn for overloaded implementations up the inheritance hierarchy. For example calling C on C will look in turn for: - void visit (AstIf* nodep, AstNUser* vup) - void visit (AstNodeIf* nodep, AstNUser* vup) - void visit (AstNodeStmt* nodep, AstNUser* vup) - void visit (AstNode* nodep, AstNUser* vup) + void visit (AstIf* nodep) + void visit (AstNodeIf* nodep) + void visit (AstNodeStmt* nodep) + void visit (AstNode* nodep) There are three ways data is passed between visitor functions. diff --git a/src/V3File.cpp b/src/V3File.cpp index a65402449..8e9791e5b 100644 --- a/src/V3File.cpp +++ b/src/V3File.cpp @@ -34,6 +34,14 @@ # define INFILTER_PIPE // Allow pipe filtering. Needs fork() #endif +#ifdef st_mtime // Linux 2.6 +# define VL_STAT_CTIME_NSEC(stat) ((stat).st_ctim.tv_nsec) // Nanoseconds +# define VL_STAT_MTIME_NSEC(stat) ((stat).st_mtim.tv_nsec) // Nanoseconds +#else +# define VL_STAT_CTIME_NSEC(stat) (0) +# define VL_STAT_MTIME_NSEC(stat) (0) +#endif + #ifdef INFILTER_PIPE # include #endif @@ -62,6 +70,7 @@ class V3FileDependImp { public: DependFile(const string& filename, bool target) : m_target(target), m_filename(filename) { + m_stat.st_ctime = 0; m_stat.st_mtime = 0; } ~DependFile() {} @@ -69,7 +78,10 @@ class V3FileDependImp { bool target() const { return m_target; } off_t size() const { return m_stat.st_size; } ino_t ino() const { return m_stat.st_ino; } - time_t mtime() const { return m_stat.st_mtime; } + time_t cstime() const { return m_stat.st_ctime; } // Seconds + time_t cnstime() const { return VL_STAT_CTIME_NSEC(m_stat); } // Nanoseconds + time_t mstime() const { return m_stat.st_mtime; } // Seconds + time_t mnstime() const { return VL_STAT_MTIME_NSEC(m_stat); } // Nanoseconds void loadStats() { if (!m_stat.st_mtime) { string fn = filename(); @@ -178,7 +190,10 @@ inline void V3FileDependImp::writeTimes(const string& filename, const string& cm *ofp<<(iter->target()?"T":"S")<<" "; *ofp<<" "<mtime(); + *ofp<<" "<cstime(); + *ofp<<" "<cnstime(); + *ofp<<" "<mstime(); + *ofp<<" "<mnstime(); *ofp<<" \""<filename()<<"\""; *ofp<>chkSize; ino_t chkIno; *ifp>>chkIno; if (ifp->eof()) break; // Needed to read final whitespace before found eof - time_t chkMtime; *ifp>>chkMtime; + time_t chkCstime; *ifp>>chkCstime; + time_t chkCnstime; *ifp>>chkCnstime; + time_t chkMstime; *ifp>>chkMstime; + time_t chkMnstime; *ifp>>chkMnstime; char quote; *ifp>>quote; string chkFilename; getline(*ifp, chkFilename, '"'); - //UINFO(9," got d="< V3StringList; typedef set V3StringSet;