Replace size method call of containers to empty method where appropriate
authorAlexander Kornienko <alexfh@google.com>
Thu, 15 Jan 2015 11:41:30 +0000 (11:41 +0000)
committerAlexander Kornienko <alexfh@google.com>
Thu, 15 Jan 2015 11:41:30 +0000 (11:41 +0000)
commit8c0809c7f8a6b8ae8d6b953f9a30a56ec584ff56
tree98e41eb51466fc2b615e8acf9011cc4076cdd05e
parent8ca43224db45c489cf7bf765d057f3d1a92be92b
Replace size method call of containers to empty method where appropriate

This patch was generated by a clang tidy checker that is being open sourced.
The documentation of that checker is the following:

/// The emptiness of a container should be checked using the empty method
/// instead of the size method. It is not guaranteed that size is a
/// constant-time function, and it is generally more efficient and also shows
/// clearer intent to use empty. Furthermore some containers may implement the
/// empty method but not implement the size method. Using empty whenever
/// possible makes it easier to switch to another container in the future.

Patch by Gábor Horváth!

llvm-svn: 226161
18 files changed:
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/lib/CodeGen/UnreachableBlockElim.cpp
llvm/lib/MC/MCMachOStreamer.cpp
llvm/lib/MC/MCParser/AsmParser.cpp
llvm/lib/ProfileData/CoverageMapping.cpp
llvm/lib/TableGen/Record.cpp
llvm/lib/TableGen/TGParser.cpp
llvm/lib/Transforms/Vectorize/BBVectorize.cpp
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/utils/TableGen/AsmMatcherEmitter.cpp
llvm/utils/TableGen/AsmWriterEmitter.cpp
llvm/utils/TableGen/CodeEmitterGen.cpp
llvm/utils/TableGen/CodeGenMapTable.cpp
llvm/utils/TableGen/DFAPacketizerEmitter.cpp
llvm/utils/TableGen/FixedLenDecoderEmitter.cpp
llvm/utils/TableGen/SubtargetEmitter.cpp
llvm/utils/TableGen/X86RecognizableInstr.cpp