Use clang-format 10.0.0

This commit is contained in:
Wilson Snyder 2020-04-28 18:47:59 -04:00
parent 77cc335c2d
commit c6d1a9858a
8 changed files with 29 additions and 29 deletions

View File

@ -460,6 +460,8 @@ CLANGFORMAT = clang-format
CLANGFORMAT_FLAGS = -i
clang-format:
@$(CLANGFORMAT) --version | egrep 10.0 > /dev/null \
|| echo "*** You are not using clang-format 10.0, indents may differ from master's ***"
$(CLANGFORMAT) $(CLANGFORMAT_FLAGS) $(CPPCHECK_CPP) $(CPPCHECK_H)
ftp: info

View File

@ -90,18 +90,17 @@ To build or run the following are optional but should be installed for
good performance:
sudo apt-get install ccache # If present at build, needed for run
sudo apt-get install libgoogle-perftools-dev
sudo apt-get install libgoogle-perftools-dev numactl
To build Verilator you will need to install these packages; these do not
need to be present to run Verilator:
sudo apt-get install git
sudo apt-get install autoconf
sudo apt-get install flex bison
sudo apt-get install autoconf flex bison
Those developing Verilator itself may also want these (see internals.adoc):
sudo apt-get install gdb asciidoctor graphviz cmake
sudo apt-get install gdb asciidoctor graphviz cmake clang-format
cpan install Pod::Perldoc
cpan install Unix::Processors
cpan install Parallel::Forker

View File

@ -2403,9 +2403,9 @@ public:
virtual void dump(std::ostream& str) const;
// For basicp() we reuse the size to indicate a "fake" basic type of same size
virtual AstBasicDType* basicp() const {
return (isFourstate() ? VN_CAST(findLogicRangeDType(VNumRange(width() - 1, 0, false),
width(), numeric()),
BasicDType)
return (isFourstate() ? VN_CAST(
findLogicRangeDType(VNumRange(width() - 1, 0, false), width(), numeric()),
BasicDType)
: VN_CAST(findBitRangeDType(VNumRange(width() - 1, 0, false),
width(), numeric()),
BasicDType));

View File

@ -203,15 +203,14 @@ void V3Number::V3NumberCreate(AstNode* nodep, const char* sourcep, FileLine* fl)
this->opAdd(product, addend);
if (product.bitsValue(width(), 4)) { // Overflowed
static int warned = 0;
v3error(
"Too many digits for "
<< width() << " bit number: " << sourcep << std::endl
<< ((!m_sized && !warned++)
? (V3Error::warnMore() + "... As that number was unsized"
+ " ('d...) it is limited to 32 bits (IEEE 1800-2017 "
"5.7.1)\n"
+ V3Error::warnMore() + "... Suggest adding a size to it.")
: ""));
v3error("Too many digits for "
<< width() << " bit number: " << sourcep << std::endl
<< ((!m_sized && !warned++) ? (
V3Error::warnMore() + "... As that number was unsized"
+ " ('d...) it is limited to 32 bits (IEEE 1800-2017 "
"5.7.1)\n"
+ V3Error::warnMore() + "... Suggest adding a size to it.")
: ""));
while (*(cp + 1)) cp++; // Skip ahead so don't get multiple warnings
}
}

View File

@ -274,7 +274,7 @@ private:
&& !m_inBBox // We may have falsely considered a SysIgnore as a driver
&& !VN_IS(nodep, VarXRef) // Xrefs might point at two different instances
&& !varp->fileline()->warnIsOff(
V3ErrorCode::ALWCOMBORDER)) { // Warn only once per variable
V3ErrorCode::ALWCOMBORDER)) { // Warn only once per variable
nodep->v3warn(ALWCOMBORDER,
"Always_comb variable driven after use: " << nodep->prettyNameQ());
varp->fileline()->modifyWarnOff(V3ErrorCode::ALWCOMBORDER,

View File

@ -120,12 +120,13 @@ private:
AstNode* abovep = prep->backp(); // Grab above point before lose it w/ next replace
prep->replaceWith(new AstVarRef(fl, varp, true));
AstIf* newp = new AstIf(fl, condp,
(needDly ? static_cast<AstNode*>(new AstAssignDly(
fl, prep, new AstVarRef(fl, varp, false)))
: static_cast<AstNode*>(new AstAssign(
fl, prep, new AstVarRef(fl, varp, false)))),
NULL);
AstIf* newp
= new AstIf(fl, condp,
(needDly ? static_cast<AstNode*>(
new AstAssignDly(fl, prep, new AstVarRef(fl, varp, false)))
: static_cast<AstNode*>(
new AstAssign(fl, prep, new AstVarRef(fl, varp, false)))),
NULL);
newp->branchPred(VBranchPred::BP_LIKELY);
if (debug() >= 9) newp->dumpTree(cout, " _new: ");
abovep->addNextStmt(newp, abovep);

View File

@ -4689,9 +4689,9 @@ private:
// We convert to/from vlsint32 rather than use floor() as want to make sure is
// representable in integer's number of bits
if (constp->isDouble()
&& v3EpsilonEqual(constp->num().toDouble(),
static_cast<double>(
static_cast<vlsint32_t>(constp->num().toDouble())))) {
&& v3EpsilonEqual(
constp->num().toDouble(),
static_cast<double>(static_cast<vlsint32_t>(constp->num().toDouble())))) {
warnOn = false;
}
}

View File

@ -502,9 +502,8 @@ static void verilate(const string& argString) {
// Can we skip doing everything if times are ok?
V3File::addSrcDepend(v3Global.opt.bin());
if (v3Global.opt.skipIdentical().isTrue()
&& V3File::checkTimes(v3Global.opt.makeDir() + "/" + v3Global.opt.prefix()
+ "__verFiles.dat",
argString)) {
&& V3File::checkTimes(
v3Global.opt.makeDir() + "/" + v3Global.opt.prefix() + "__verFiles.dat", argString)) {
UINFO(1, "--skip-identical: No change to any source files, exiting\n");
return;
}