[llvm] 435a5a3 - [llvm] Fix bugprone argument comments (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 8 11:56:57 PST 2022
Author: Kazu Hirata
Date: 2022-01-08T11:56:38-08:00
New Revision: 435a5a365207d0f4b1be35a1ea3bcd4981950b20
URL: https://github.com/llvm/llvm-project/commit/435a5a365207d0f4b1be35a1ea3bcd4981950b20
DIFF: https://github.com/llvm/llvm-project/commit/435a5a365207d0f4b1be35a1ea3bcd4981950b20.diff
LOG: [llvm] Fix bugprone argument comments (NFC)
Identified with bugprone-argument-comment.
Added:
Modified:
llvm/lib/Bitcode/Reader/MetadataLoader.cpp
llvm/lib/DWARFLinker/DWARFLinkerDeclContext.cpp
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
llvm/lib/MC/MCStreamer.cpp
llvm/lib/Support/ARMAttributeParser.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/tools/llvm-cov/CodeCoverage.cpp
llvm/tools/llvm-cov/CoverageReport.cpp
llvm/tools/llvm-cov/SourceCoverageView.cpp
llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp
llvm/tools/llvm-objdump/llvm-objdump.cpp
llvm/tools/llvm-reduce/ReducerWorkItem.cpp
llvm/tools/obj2yaml/dwarf2yaml.cpp
llvm/utils/TableGen/InstrInfoEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
index 133a7b8aec3a3..67144d432d41d 100644
--- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
+++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
@@ -1675,7 +1675,7 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata(
SPFlags = DISubprogram::toSPFlags(
/*IsLocalToUnit=*/Record[7], /*IsDefinition=*/Record[8],
/*IsOptimized=*/Record[14], /*Virtuality=*/Record[11],
- /*DIFlagMainSubprogram=*/HasOldMainSubprogramFlag);
+ /*IsMainSubprogram=*/HasOldMainSubprogramFlag);
// All definitions should be distinct.
IsDistinct = (Record[0] & 1) || (SPFlags & DISubprogram::SPFlagDefinition);
diff --git a/llvm/lib/DWARFLinker/DWARFLinkerDeclContext.cpp b/llvm/lib/DWARFLinker/DWARFLinkerDeclContext.cpp
index d9b3c4235b4de..5ab2ad0780a29 100644
--- a/llvm/lib/DWARFLinker/DWARFLinkerDeclContext.cpp
+++ b/llvm/lib/DWARFLinker/DWARFLinkerDeclContext.cpp
@@ -173,7 +173,7 @@ DeclContextTree::getChildDeclContext(DeclContext &Context, const DWARFDie &DIE,
!(*ContextIter)->setLastSeenDIE(U, DIE)) {
// The context was found, but it is ambiguous with another context
// in the same file. Mark it invalid.
- return PointerIntPair<DeclContext *, 1>(*ContextIter, /* Invalid= */ 1);
+ return PointerIntPair<DeclContext *, 1>(*ContextIter, /* IntVal= */ 1);
}
assert(ContextIter != Contexts.end());
@@ -183,7 +183,7 @@ DeclContextTree::getChildDeclContext(DeclContext &Context, const DWARFDie &DIE,
Context.getTag() != dwarf::DW_TAG_structure_type &&
Context.getTag() != dwarf::DW_TAG_class_type) ||
(Tag == dwarf::DW_TAG_union_type))
- return PointerIntPair<DeclContext *, 1>(*ContextIter, /* Invalid= */ 1);
+ return PointerIntPair<DeclContext *, 1>(*ContextIter, /* IntVal= */ 1);
return PointerIntPair<DeclContext *, 1>(*ContextIter);
}
diff --git a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
index de2507631f00d..68709953b48b4 100644
--- a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+++ b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
@@ -2268,7 +2268,7 @@ static int32_t computeHeuristicUnrollFactor(CanonicalLoopInfo *CLI) {
gatherPeelingPreferences(L, SE, TTI,
/*UserAllowPeeling=*/false,
/*UserAllowProfileBasedPeeling=*/false,
- /*UserUnrollingSpecficValues=*/false);
+ /*UnrollingSpecficValues=*/false);
SmallPtrSet<const Value *, 32> EphValues;
CodeMetrics::collectEphemeralValues(L, &AC, EphValues);
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp
index 9c37a7bebe2af..a14f0de65a9d1 100644
--- a/llvm/lib/MC/MCStreamer.cpp
+++ b/llvm/lib/MC/MCStreamer.cpp
@@ -1348,8 +1348,8 @@ void MCStreamer::emitVersionForTarget(
DarwinTargetVariantTriple->isMacOSX()) {
emitVersionForTarget(*DarwinTargetVariantTriple,
DarwinTargetVariantSDKVersion,
- /*TargetVariantTriple=*/nullptr,
- /*TargetVariantSDKVersion=*/VersionTuple());
+ /*DarwinTargetVariantTriple=*/nullptr,
+ /*DarwinTargetVariantSDKVersion=*/VersionTuple());
emitDarwinTargetVariantBuildVersion(
getMachoBuildVersionPlatformType(Target),
LinkedTargetVersion.getMajor(),
diff --git a/llvm/lib/Support/ARMAttributeParser.cpp b/llvm/lib/Support/ARMAttributeParser.cpp
index 241cfb1eedbe2..4b07fb7c87140 100644
--- a/llvm/lib/Support/ARMAttributeParser.cpp
+++ b/llvm/lib/Support/ARMAttributeParser.cpp
@@ -70,7 +70,7 @@ const ARMAttributeParser::DisplayHandler ARMAttributeParser::displayRoutines[] =
Error ARMAttributeParser::stringAttribute(AttrType tag) {
StringRef tagName =
- ELFAttrs::attrTypeAsString(tag, tagToStringMap, /*TagPrefix=*/false);
+ ELFAttrs::attrTypeAsString(tag, tagToStringMap, /*hasTagPrefix=*/false);
StringRef desc = de.getCStrRef(cursor);
if (sw) {
diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index bf925f317d9c2..717c7a89a01be 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -8623,7 +8623,7 @@ static SDValue unpackFromMemLoc(SelectionDAG &DAG, SDValue Chain,
ValVT = LocVT;
}
int FI = MFI.CreateFixedObject(ValVT.getStoreSize(), VA.getLocMemOffset(),
- /*Immutable=*/true);
+ /*IsImmutable=*/true);
SDValue FIN = DAG.getFrameIndex(FI, PtrVT);
SDValue Val;
@@ -8653,7 +8653,8 @@ static SDValue unpackF64OnRV32DSoftABI(SelectionDAG &DAG, SDValue Chain,
if (VA.isMemLoc()) {
// f64 is passed on the stack.
- int FI = MFI.CreateFixedObject(8, VA.getLocMemOffset(), /*Immutable=*/true);
+ int FI =
+ MFI.CreateFixedObject(8, VA.getLocMemOffset(), /*IsImmutable=*/true);
SDValue FIN = DAG.getFrameIndex(FI, MVT::i32);
return DAG.getLoad(MVT::f64, DL, Chain, FIN,
MachinePointerInfo::getFixedStack(MF, FI));
@@ -8667,7 +8668,7 @@ static SDValue unpackF64OnRV32DSoftABI(SelectionDAG &DAG, SDValue Chain,
SDValue Hi;
if (VA.getLocReg() == RISCV::X17) {
// Second half of f64 is passed on the stack.
- int FI = MFI.CreateFixedObject(4, 0, /*Immutable=*/true);
+ int FI = MFI.CreateFixedObject(4, 0, /*IsImmutable=*/true);
SDValue FIN = DAG.getFrameIndex(FI, MVT::i32);
Hi = DAG.getLoad(MVT::i32, DL, Chain, FIN,
MachinePointerInfo::getFixedStack(MF, FI));
diff --git a/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
index 7c7d3ee13de77..ff3aa14a2a83c 100644
--- a/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
@@ -1201,7 +1201,7 @@ Constant *DataFlowSanitizer::getOrBuildTrampolineFunction(FunctionType *FT,
// F is called by a wrapped custom function with primitive shadows. So
// its arguments and return value need conversion.
DFSanFunction DFSF(*this, F, /*IsNativeABI=*/true,
- /*ForceZeroLabels=*/false);
+ /*IsForceZeroLabels=*/false);
Function::arg_iterator ValAI = F->arg_begin(), ShadowAI = AI;
++ValAI;
for (unsigned N = FT->getNumParams(); N != 0; ++ValAI, ++ShadowAI, --N) {
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 14ee0adf2d0a2..015973d65f4ff 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -9233,7 +9233,7 @@ class HorizontalReduction {
auto *SclCondTy = CmpInst::makeCmpResultType(ScalarTy);
auto *VecCondTy = cast<VectorType>(CmpInst::makeCmpResultType(VectorTy));
VectorCost = TTI->getMinMaxReductionCost(VectorTy, VecCondTy,
- /*unsigned=*/false, CostKind);
+ /*IsUnsigned=*/false, CostKind);
CmpInst::Predicate RdxPred = getMinMaxReductionPredicate(RdxKind);
ScalarCost = TTI->getCmpSelInstrCost(Instruction::FCmp, ScalarTy,
SclCondTy, RdxPred, CostKind) +
diff --git a/llvm/tools/llvm-cov/CodeCoverage.cpp b/llvm/tools/llvm-cov/CodeCoverage.cpp
index d357ad7c9e100..ef801287c1be4 100644
--- a/llvm/tools/llvm-cov/CodeCoverage.cpp
+++ b/llvm/tools/llvm-cov/CodeCoverage.cpp
@@ -209,7 +209,7 @@ void CodeCoverageTool::addCollectedPath(const std::string &Path) {
error(EC.message(), Path);
return;
}
- sys::path::remove_dots(EffectivePath, /*remove_dot_dots=*/true);
+ sys::path::remove_dots(EffectivePath, /*remove_dot_dot=*/true);
if (!IgnoreFilenameFilters.matchesFilename(EffectivePath))
SourceFiles.emplace_back(EffectivePath.str());
HadSourceFiles = !SourceFiles.empty();
diff --git a/llvm/tools/llvm-cov/CoverageReport.cpp b/llvm/tools/llvm-cov/CoverageReport.cpp
index 2c08f53094941..c91edc2b0dc08 100644
--- a/llvm/tools/llvm-cov/CoverageReport.cpp
+++ b/llvm/tools/llvm-cov/CoverageReport.cpp
@@ -179,7 +179,7 @@ void CoverageReport::render(const FileCoverageSummary &File,
determineCoveragePercentageColor(File.InstantiationCoverage);
auto LineCoverageColor = determineCoveragePercentageColor(File.LineCoverage);
SmallString<256> FileName = File.Name;
- sys::path::remove_dots(FileName, /*remove_dot_dots=*/true);
+ sys::path::remove_dots(FileName, /*remove_dot_dot=*/true);
sys::path::native(FileName);
OS << column(FileName, FileReportColumns[0], Column::NoTrim);
diff --git a/llvm/tools/llvm-cov/SourceCoverageView.cpp b/llvm/tools/llvm-cov/SourceCoverageView.cpp
index aca58a07f2509..ea86acadf0014 100644
--- a/llvm/tools/llvm-cov/SourceCoverageView.cpp
+++ b/llvm/tools/llvm-cov/SourceCoverageView.cpp
@@ -41,7 +41,7 @@ std::string CoveragePrinter::getOutputPath(StringRef Path, StringRef Extension,
sys::path::append(FullPath, getCoverageDir());
SmallString<256> ParentPath = sys::path::parent_path(Path);
- sys::path::remove_dots(ParentPath, /*remove_dot_dots=*/true);
+ sys::path::remove_dots(ParentPath, /*remove_dot_dot=*/true);
sys::path::append(FullPath, sys::path::relative_path(ParentPath));
auto PathFilename = (sys::path::filename(Path) + "." + Extension).str();
@@ -157,7 +157,7 @@ SourceCoverageView::create(StringRef SourceName, const MemoryBuffer &File,
std::string SourceCoverageView::getSourceName() const {
SmallString<128> SourceText(SourceName);
- sys::path::remove_dots(SourceText, /*remove_dot_dots=*/true);
+ sys::path::remove_dots(SourceText, /*remove_dot_dot=*/true);
sys::path::native(SourceText);
return std::string(SourceText.str());
}
diff --git a/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp b/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp
index 7ab1d6608ccfb..56efc40b9349c 100644
--- a/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp
+++ b/llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp
@@ -322,7 +322,7 @@ std::string
CoveragePrinterHTML::buildLinkToFile(StringRef SF,
const FileCoverageSummary &FCS) const {
SmallString<128> LinkTextStr(sys::path::relative_path(FCS.Name));
- sys::path::remove_dots(LinkTextStr, /*remove_dot_dots=*/true);
+ sys::path::remove_dots(LinkTextStr, /*remove_dot_dot=*/true);
sys::path::native(LinkTextStr);
std::string LinkText = escape(LinkTextStr, Opts);
std::string LinkTarget =
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index a16f760cd1cb4..6b238fa01d258 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -2715,7 +2715,7 @@ int main(int argc, char **argv) {
return 0;
}
if (InputArgs.hasArg(HelpHiddenFlag)) {
- T->printHelp(ToolName, /*show_hidden=*/true);
+ T->printHelp(ToolName, /*ShowHidden=*/true);
return 0;
}
diff --git a/llvm/tools/llvm-reduce/ReducerWorkItem.cpp b/llvm/tools/llvm-reduce/ReducerWorkItem.cpp
index e3845e8b897a7..d6e4f20186696 100644
--- a/llvm/tools/llvm-reduce/ReducerWorkItem.cpp
+++ b/llvm/tools/llvm-reduce/ReducerWorkItem.cpp
@@ -88,7 +88,7 @@ static std::unique_ptr<MachineFunction> cloneMF(MachineFunction *SrcMF) {
}
}
- DstMF->verify(nullptr, "", /*AbortOnErrors=*/true);
+ DstMF->verify(nullptr, "", /*AbortOnError=*/true);
return DstMF;
}
@@ -159,7 +159,7 @@ cloneReducerWorkItem(const ReducerWorkItem &MMM) {
bool verifyReducerWorkItem(const ReducerWorkItem &MMM, raw_fd_ostream *OS) {
if (verifyModule(*MMM.M, OS))
return true;
- if (MMM.MF && !MMM.MF->verify(nullptr, "", /*AbortOnErrors=*/false))
+ if (MMM.MF && !MMM.MF->verify(nullptr, "", /*AbortOnError=*/false))
return true;
return false;
}
diff --git a/llvm/tools/obj2yaml/dwarf2yaml.cpp b/llvm/tools/obj2yaml/dwarf2yaml.cpp
index 8c164e24d619c..8cae1f3c49077 100644
--- a/llvm/tools/obj2yaml/dwarf2yaml.cpp
+++ b/llvm/tools/obj2yaml/dwarf2yaml.cpp
@@ -51,7 +51,7 @@ Error dumpDebugAddr(DWARFContext &DCtx, DWARFYAML::Data &Y) {
DWARFDebugAddrTable AddrTable;
DWARFDataExtractor AddrData(DCtx.getDWARFObj(),
DCtx.getDWARFObj().getAddrSection(),
- DCtx.isLittleEndian(), /*AddrSize=*/0);
+ DCtx.isLittleEndian(), /*AddressSize=*/0);
std::vector<DWARFYAML::AddrTableEntry> AddrTables;
uint64_t Offset = 0;
while (AddrData.isValidOffset(Offset)) {
diff --git a/llvm/utils/TableGen/InstrInfoEmitter.cpp b/llvm/utils/TableGen/InstrInfoEmitter.cpp
index aee887a906e54..3c92aa0cc27ac 100644
--- a/llvm/utils/TableGen/InstrInfoEmitter.cpp
+++ b/llvm/utils/TableGen/InstrInfoEmitter.cpp
@@ -863,13 +863,13 @@ void InstrInfoEmitter::run(raw_ostream &OS) {
OS << "#ifdef GET_INSTRINFO_HELPER_DECLS\n";
OS << "#undef GET_INSTRINFO_HELPER_DECLS\n\n";
- emitTIIHelperMethods(OS, TargetName, /* ExpandDefintion = */false);
+ emitTIIHelperMethods(OS, TargetName, /* ExpandDefinition = */ false);
OS << "\n";
OS << "#endif // GET_INSTRINFO_HELPER_DECLS\n\n";
OS << "#ifdef GET_INSTRINFO_HELPERS\n";
OS << "#undef GET_INSTRINFO_HELPERS\n\n";
- emitTIIHelperMethods(OS, TargetName, /* ExpandDefintion = */true);
+ emitTIIHelperMethods(OS, TargetName, /* ExpandDefinition = */ true);
OS << "#endif // GET_INSTRINFO_HELPERS\n\n";
OS << "#ifdef GET_INSTRINFO_CTOR_DTOR\n";
More information about the llvm-commits
mailing list