[PATCH] D108013: [NFC] Rename AttributeList::has/getAttribute() -> has/getAttributeImpl()

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 12 22:25:38 PDT 2021


aeubanks created this revision.
Herald added subscribers: ormris, foad, dexonsmith, lxfind, okura, jdoerfert, kuter, kerbowa, pengfei, Jim, hiraditya, jgravelle-google, sbc100, nhaehnle, jvesely, dylanmckay, dschuff, arsenm, jholewinski.
aeubanks added reviewers: rnk, efriedma.
aeubanks published this revision for review.
Herald added subscribers: llvm-commits, cfe-commits, aheejin.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: sstefan1.
Herald added a reviewer: baziotis.
Herald added projects: clang, LLVM.

I've been bitten by AttributeList::getAttribute() multiple times now,
thinking that it's getParamAttribute(). Renaming it makes it clearer
that callers should use the param/fn/ret version so they don't have to
worry about the somewhat horrifying implementation details of the
attribute indexes.

I couldn't quite manage to make the methods private since some callers
need larger cleanups. Also, the C API directly uses the indexes. Perhaps
we can clean things up in the future.

Currently the naming is inconsistent (Attribute vs Attr), I'll clean
that in in a followup change.

This doesn't touch addAttribute(), I'll also clean that up in a followup
change since this change is already large enough.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108013

Files:
  clang/lib/CodeGen/CodeGenModule.cpp
  llvm/include/llvm/IR/Attributes.h
  llvm/include/llvm/IR/Function.h
  llvm/include/llvm/IR/InstrTypes.h
  llvm/lib/Analysis/Lint.cpp
  llvm/lib/Analysis/VectorUtils.cpp
  llvm/lib/AsmParser/LLParser.cpp
  llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
  llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
  llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
  llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
  llvm/lib/CodeGen/MachinePipeliner.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  llvm/lib/CodeGen/TargetLoweringBase.cpp
  llvm/lib/IR/AsmWriter.cpp
  llvm/lib/IR/Attributes.cpp
  llvm/lib/IR/Core.cpp
  llvm/lib/IR/Function.cpp
  llvm/lib/IR/Instructions.cpp
  llvm/lib/IR/Statepoint.cpp
  llvm/lib/IR/Verifier.cpp
  llvm/lib/Linker/IRMover.cpp
  llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
  llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
  llvm/lib/Target/AVR/AVRISelLowering.cpp
  llvm/lib/Target/Hexagon/HexagonOptimizeSZextends.cpp
  llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp
  llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
  llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
  llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/lib/Transforms/Coroutines/CoroSplit.cpp
  llvm/lib/Transforms/IPO/Attributor.cpp
  llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
  llvm/lib/Transforms/IPO/FunctionAttrs.cpp
  llvm/lib/Transforms/IPO/GlobalOpt.cpp
  llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
  llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
  llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
  llvm/lib/Transforms/Utils/AssumeBundleBuilder.cpp
  llvm/lib/Transforms/Utils/BuildLibCalls.cpp
  llvm/lib/Transforms/Utils/FunctionComparator.cpp
  llvm/lib/Transforms/Utils/ValueMapper.cpp
  llvm/tools/llvm-reduce/deltas/ReduceAttributes.cpp
  llvm/unittests/IR/AttributesTest.cpp
  llvm/unittests/Transforms/Utils/VFABIUtils.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108013.366187.patch
Type: text/x-patch
Size: 70190 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210813/e411d397/attachment.bin>


More information about the llvm-commits mailing list