From afa9824a92d8968c3f85bed2740c35fa79a4d4c1 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Tue, 11 Apr 2017 14:55:32 +0000 Subject: [PATCH] Remove unused functions. Remove static qualifier from functions in header files. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299947 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/PointerUnion.h | 6 +++--- include/llvm/Analysis/LoopInfoImpl.h | 7 +++---- include/llvm/ExecutionEngine/Orc/RPCUtils.h | 4 ++-- include/llvm/Object/ELF.h | 2 +- lib/Analysis/InlineCost.cpp | 7 ------- lib/DebugInfo/CodeView/CVSymbolVisitor.cpp | 9 --------- lib/IR/Verifier.cpp | 22 --------------------- lib/Object/MachOObjectFile.cpp | 7 ------- lib/Target/AMDGPU/AMDILCFGStructurizer.cpp | 10 ---------- 9 files changed, 9 insertions(+), 65 deletions(-) diff --git a/include/llvm/ADT/PointerUnion.h b/include/llvm/ADT/PointerUnion.h index 020c5ed44c4..9eb15524c0f 100644 --- a/include/llvm/ADT/PointerUnion.h +++ b/include/llvm/ADT/PointerUnion.h @@ -190,17 +190,17 @@ public: }; template -static bool operator==(PointerUnion lhs, PointerUnion rhs) { +bool operator==(PointerUnion lhs, PointerUnion rhs) { return lhs.getOpaqueValue() == rhs.getOpaqueValue(); } template -static bool operator!=(PointerUnion lhs, PointerUnion rhs) { +bool operator!=(PointerUnion lhs, PointerUnion rhs) { return lhs.getOpaqueValue() != rhs.getOpaqueValue(); } template -static bool operator<(PointerUnion lhs, PointerUnion rhs) { +bool operator<(PointerUnion lhs, PointerUnion rhs) { return lhs.getOpaqueValue() < rhs.getOpaqueValue(); } diff --git a/include/llvm/Analysis/LoopInfoImpl.h b/include/llvm/Analysis/LoopInfoImpl.h index 0febe7b1a8b..761f8721b54 100644 --- a/include/llvm/Analysis/LoopInfoImpl.h +++ b/include/llvm/Analysis/LoopInfoImpl.h @@ -577,10 +577,9 @@ bool compareVectors(std::vector &BB1, std::vector &BB2) { } template -static void -addInnerLoopsToHeadersMap(DenseMap &LoopHeaders, - const LoopInfoBase &LI, - const LoopT &L) { +void addInnerLoopsToHeadersMap(DenseMap &LoopHeaders, + const LoopInfoBase &LI, + const LoopT &L) { LoopHeaders[L.getHeader()] = &L; for (LoopT *SL : L) addInnerLoopsToHeadersMap(LoopHeaders, LI, *SL); diff --git a/include/llvm/ExecutionEngine/Orc/RPCUtils.h b/include/llvm/ExecutionEngine/Orc/RPCUtils.h index 5aa1ef8d39a..fe7e1ba6ff7 100644 --- a/include/llvm/ExecutionEngine/Orc/RPCUtils.h +++ b/include/llvm/ExecutionEngine/Orc/RPCUtils.h @@ -289,8 +289,8 @@ static Error respond(ChannelT &C, const FunctionIdT &ResponseId, // the handler ran. template -static Error respond(ChannelT &C, const FunctionIdT &ResponseId, - SequenceNumberT SeqNo, Error Err) { +Error respond(ChannelT &C, const FunctionIdT &ResponseId, SequenceNumberT SeqNo, + Error Err) { if (Err) return Err; if (auto Err2 = C.startSendMessage(ResponseId, SeqNo)) diff --git a/include/llvm/Object/ELF.h b/include/llvm/Object/ELF.h index aaa79ae70f0..7a3155b3953 100644 --- a/include/llvm/Object/ELF.h +++ b/include/llvm/Object/ELF.h @@ -340,7 +340,7 @@ ELFFile::ELFFile(StringRef Object) : Buf(Object) { } template -static bool compareAddr(uint64_t VAddr, const Elf_Phdr_Impl *Phdr) { +bool compareAddr(uint64_t VAddr, const Elf_Phdr_Impl *Phdr) { return VAddr < Phdr->p_vaddr; } diff --git a/lib/Analysis/InlineCost.cpp b/lib/Analysis/InlineCost.cpp index ec14d1bf003..376a22bd987 100644 --- a/lib/Analysis/InlineCost.cpp +++ b/lib/Analysis/InlineCost.cpp @@ -1438,13 +1438,6 @@ LLVM_DUMP_METHOD void CallAnalyzer::dump() { } #endif -/// \brief Test that two functions either have or have not the given attribute -/// at the same time. -template -static bool attributeMatches(Function *F1, Function *F2, AttrKind Attr) { - return F1->getFnAttribute(Attr) == F2->getFnAttribute(Attr); -} - /// \brief Test that there are no attribute conflicts between Caller and Callee /// that prevent inlining. static bool functionsHaveCompatibleAttributes(Function *Caller, diff --git a/lib/DebugInfo/CodeView/CVSymbolVisitor.cpp b/lib/DebugInfo/CodeView/CVSymbolVisitor.cpp index d269d89ddba..4c78caf0347 100644 --- a/lib/DebugInfo/CodeView/CVSymbolVisitor.cpp +++ b/lib/DebugInfo/CodeView/CVSymbolVisitor.cpp @@ -16,15 +16,6 @@ using namespace llvm; using namespace llvm::codeview; -template -static Error takeObject(ArrayRef &Data, const T *&Res) { - if (Data.size() < sizeof(*Res)) - return llvm::make_error(cv_error_code::insufficient_buffer); - Res = reinterpret_cast(Data.data()); - Data = Data.drop_front(sizeof(*Res)); - return Error::success(); -} - CVSymbolVisitor::CVSymbolVisitor(SymbolVisitorCallbacks &Callbacks) : Callbacks(Callbacks) {} diff --git a/lib/IR/Verifier.cpp b/lib/IR/Verifier.cpp index 42751859a47..893890446b7 100644 --- a/lib/IR/Verifier.cpp +++ b/lib/IR/Verifier.cpp @@ -832,28 +832,6 @@ static bool isType(const Metadata *MD) { return !MD || isa(MD); } static bool isScope(const Metadata *MD) { return !MD || isa(MD); } static bool isDINode(const Metadata *MD) { return !MD || isa(MD); } -template -static bool isValidMetadataArrayImpl(const MDTuple &N, bool AllowNull) { - for (Metadata *MD : N.operands()) { - if (MD) { - if (!isa(MD)) - return false; - } else { - if (!AllowNull) - return false; - } - } - return true; -} - -template static bool isValidMetadataArray(const MDTuple &N) { - return isValidMetadataArrayImpl(N, /* AllowNull */ false); -} - -template static bool isValidMetadataNullArray(const MDTuple &N) { - return isValidMetadataArrayImpl(N, /* AllowNull */ true); -} - void Verifier::visitDILocation(const DILocation &N) { AssertDI(N.getRawScope() && isa(N.getRawScope()), "location requires a valid scope", &N, N.getRawScope()); diff --git a/lib/Object/MachOObjectFile.cpp b/lib/Object/MachOObjectFile.cpp index f2c2aead5a9..1753d2baaed 100644 --- a/lib/Object/MachOObjectFile.cpp +++ b/lib/Object/MachOObjectFile.cpp @@ -106,13 +106,6 @@ static StringRef parseSegmentOrSectionName(const char *P) { return StringRef(P, 16); } -// Helper to advance a section or symbol iterator multiple increments at a time. -template -static void advance(T &it, size_t Val) { - while (Val--) - ++it; -} - static unsigned getCPUType(const MachOObjectFile &O) { return O.getHeader().cputype; } diff --git a/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp b/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp index d150984f882..1a393845a82 100644 --- a/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp +++ b/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp @@ -99,16 +99,6 @@ DEBUG( \ #define INVALIDSCCNUM -1 -template -void ReverseVector(SmallVectorImpl &Src) { - size_t sz = Src.size(); - for (size_t i = 0; i < sz/2; ++i) { - NodeT *t = Src[i]; - Src[i] = Src[sz - i - 1]; - Src[sz - i - 1] = t; - } -} - //===----------------------------------------------------------------------===// // // supporting data structure for CFGStructurizer -- 2.50.1