From ba9af4aabfa5b02f4d3e9175f348a58f26a4192b Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 29 Jun 2019 07:39:17 -0400 Subject: [PATCH] For internal messages, use and to match GCC. --- src/V3AstNodes.h | 2 +- src/V3FileLine.cpp | 6 +- src/V3FileLine.h | 7 ++- src/V3Number_test.cpp | 2 +- src/V3PreShell.cpp | 2 +- test_regress/t/t_xml_first.out | 95 +++++++++++++++-------------- test_regress/t/t_xml_tag.out | 107 ++++++++++++++++----------------- 7 files changed, 110 insertions(+), 111 deletions(-) diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index 9fd572a3d..207669d47 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -6118,7 +6118,7 @@ private: AstExecGraph* m_execGraphp; // Execution MTask graph for threads>1 mode public: AstNetlist() - : AstNode(new FileLine("AstRoot", 0)) + : AstNode(new FileLine(FileLine::builtInFilename(), 0)) , m_typeTablep(NULL) , m_dollarUnitPkgp(NULL) , m_evalp(NULL) diff --git a/src/V3FileLine.cpp b/src/V3FileLine.cpp index 48bce4bd0..7bb6c786f 100644 --- a/src/V3FileLine.cpp +++ b/src/V3FileLine.cpp @@ -28,6 +28,7 @@ # include "V3Global.h" # include "V3Stats.h" # include "V3Config.h" +# include "V3File.h" #endif #include @@ -68,13 +69,12 @@ int FileLineSingleton::nameToNumber(const string& filename) { } //! Support XML output - //! Experimental. Updated to also put out the language. void FileLineSingleton::fileNameNumMapDumpXml(std::ostream& os) { os<<"\n"; for (FileNameNumMap::const_iterator it = m_namemap.begin(); it != m_namemap.end(); ++it) { os<<"second) - <<"\" filename=\""<first + <<"\" filename=\""<first, V3OutFormatter::LA_XML) <<"\" language=\""<second).ascii()<<"\"/>\n"; } os<<"\n"; @@ -86,7 +86,7 @@ void FileLineSingleton::fileNameNumMapDumpXml(std::ostream& os) { FileLine::FileLine(FileLine::EmptySecret) { // Sort of a singleton m_lineno = 0; - m_filenameno = singleton().nameToNumber("AstRoot"); + m_filenameno = singleton().nameToNumber(FileLine::builtInFilename()); m_parent = NULL; m_warnOn = 0; diff --git a/src/V3FileLine.h b/src/V3FileLine.h index 0dd622e7b..62c501dea 100644 --- a/src/V3FileLine.h +++ b/src/V3FileLine.h @@ -130,7 +130,7 @@ public: string ascii() const; const string filename() const { return singleton().numberToName(m_filenameno); } bool filenameIsGlobal() const { return (filename() == commandLineFilename() - || filename() == internalDefineFilename()); } + || filename() == builtInFilename()); } const string filenameLetters() const { return singleton().filenameLetters(m_filenameno); } const string filebasename() const; const string filebasenameNoExt() const; @@ -155,8 +155,9 @@ public: void tracingOn(bool flag) { warnOn(V3ErrorCode::I_TRACING, flag); } // METHODS - Global - static string commandLineFilename() { return "COMMAND_LINE"; } - static string internalDefineFilename() { return "INTERNAL_VERILATOR_DEFINE"; } + // and match what GCC outputs + static string commandLineFilename() { return ""; } + static string builtInFilename() { return ""; } static void globalWarnLintOff(bool flag) { defaultFileLine().warnLintOff(flag); } static void globalWarnStyleOff(bool flag) { diff --git a/src/V3Number_test.cpp b/src/V3Number_test.cpp index 672a8488f..9cb4cba2f 100644 --- a/src/V3Number_test.cpp +++ b/src/V3Number_test.cpp @@ -38,7 +38,7 @@ void test(const string& lhss, const string& op, const string& rhss, const string char* r1 = strdup(rhss.c_str()); char* e1 = strdup(exps.c_str()); - FileLine fl = new FileLine(FileLine::internalDefineFinename(), 0); + FileLine fl = new FileLine(FileLine::builtInFinename(), 0); V3Number lhnum (fl, l1); V3Number rhnum (fl, r1); diff --git a/src/V3PreShell.cpp b/src/V3PreShell.cpp index 379bad192..cf03b93dc 100644 --- a/src/V3PreShell.cpp +++ b/src/V3PreShell.cpp @@ -64,7 +64,7 @@ protected: s_preprocp = V3PreProc::createPreProc(cmdfl); s_preprocp->debug(debug()); // Default defines - FileLine* prefl = new FileLine(FileLine::internalDefineFilename(), 0); + FileLine* prefl = new FileLine(FileLine::builtInFilename(), 0); s_preprocp->defineCmdLine(prefl, "VERILATOR", "1"); // LEAK_OK s_preprocp->defineCmdLine(prefl, "verilator", "1"); // LEAK_OK s_preprocp->defineCmdLine(prefl, "verilator3", "1"); // LEAK_OK diff --git a/test_regress/t/t_xml_first.out b/test_regress/t/t_xml_first.out index f535d8976..064080960 100644 --- a/test_regress/t/t_xml_first.out +++ b/test_regress/t/t_xml_first.out @@ -2,78 +2,77 @@ - - - - - + + + + - + - - - + + + - - - - - - - - + + + + + + + + - - + + - - + + - - - + + + - - + + - - + + - - - - - - - - + + + + + + + + - - - + + + - - - - - - - + + + + + + + - - + + diff --git a/test_regress/t/t_xml_tag.out b/test_regress/t/t_xml_tag.out index 3c215a08f..3dc4e5dad 100644 --- a/test_regress/t/t_xml_tag.out +++ b/test_regress/t/t_xml_tag.out @@ -2,82 +2,81 @@ - - - - - + + + + - + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - + + + + - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + + - - + +