]> granicus.if.org Git - llvm/commitdiff
Remove unused functions. Remove static qualifier from functions in header files....
authorVassil Vassilev <v.g.vassilev@gmail.com>
Tue, 11 Apr 2017 14:55:32 +0000 (14:55 +0000)
committerVassil Vassilev <v.g.vassilev@gmail.com>
Tue, 11 Apr 2017 14:55:32 +0000 (14:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299947 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/PointerUnion.h
include/llvm/Analysis/LoopInfoImpl.h
include/llvm/ExecutionEngine/Orc/RPCUtils.h
include/llvm/Object/ELF.h
lib/Analysis/InlineCost.cpp
lib/DebugInfo/CodeView/CVSymbolVisitor.cpp
lib/IR/Verifier.cpp
lib/Object/MachOObjectFile.cpp
lib/Target/AMDGPU/AMDILCFGStructurizer.cpp

index 020c5ed44c42b809038f151aabdb5c512e0423a4..9eb15524c0f3059918d08e37e5596e3ea9e53f31 100644 (file)
@@ -190,17 +190,17 @@ public:
 };
 
 template <typename PT1, typename PT2>
-static bool operator==(PointerUnion<PT1, PT2> lhs, PointerUnion<PT1, PT2> rhs) {
+bool operator==(PointerUnion<PT1, PT2> lhs, PointerUnion<PT1, PT2> rhs) {
   return lhs.getOpaqueValue() == rhs.getOpaqueValue();
 }
 
 template <typename PT1, typename PT2>
-static bool operator!=(PointerUnion<PT1, PT2> lhs, PointerUnion<PT1, PT2> rhs) {
+bool operator!=(PointerUnion<PT1, PT2> lhs, PointerUnion<PT1, PT2> rhs) {
   return lhs.getOpaqueValue() != rhs.getOpaqueValue();
 }
 
 template <typename PT1, typename PT2>
-static bool operator<(PointerUnion<PT1, PT2> lhs, PointerUnion<PT1, PT2> rhs) {
+bool operator<(PointerUnion<PT1, PT2> lhs, PointerUnion<PT1, PT2> rhs) {
   return lhs.getOpaqueValue() < rhs.getOpaqueValue();
 }
 
index 0febe7b1a8bd1e50da6df94d4f659490efdf7193..761f8721b54fda6ba14b0d4fff1849545c4a0824 100644 (file)
@@ -577,10 +577,9 @@ bool compareVectors(std::vector<T> &BB1, std::vector<T> &BB2) {
 }
 
 template <class BlockT, class LoopT>
-static void
-addInnerLoopsToHeadersMap(DenseMap<BlockT *, const LoopT *> &LoopHeaders,
-                          const LoopInfoBase<BlockT, LoopT> &LI,
-                          const LoopT &L) {
+void addInnerLoopsToHeadersMap(DenseMap<BlockT *, const LoopT *> &LoopHeaders,
+                               const LoopInfoBase<BlockT, LoopT> &LI,
+                               const LoopT &L) {
   LoopHeaders[L.getHeader()] = &L;
   for (LoopT *SL : L)
     addInnerLoopsToHeadersMap(LoopHeaders, LI, *SL);
index 5aa1ef8d39a5c8f0da640a9fabe2c26f484d90c6..fe7e1ba6ff78bb6c3274989b180726dabc353891 100644 (file)
@@ -289,8 +289,8 @@ static Error respond(ChannelT &C, const FunctionIdT &ResponseId,
 // the handler ran.
 template <typename WireRetT, typename ChannelT, typename FunctionIdT,
           typename SequenceNumberT>
-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))
index aaa79ae70f01d62a4d47f4f5fe324efb9f99082e..7a3155b3953ecd8fe55c5b85baf3f158eb2530ef 100644 (file)
@@ -340,7 +340,7 @@ ELFFile<ELFT>::ELFFile(StringRef Object) : Buf(Object) {
 }
 
 template <class ELFT>
-static bool compareAddr(uint64_t VAddr, const Elf_Phdr_Impl<ELFT> *Phdr) {
+bool compareAddr(uint64_t VAddr, const Elf_Phdr_Impl<ELFT> *Phdr) {
   return VAddr < Phdr->p_vaddr;
 }
 
index ec14d1bf00324771425c2de51c5735192fe832f9..376a22bd987a36b370e4108f758781197820659c 100644 (file)
@@ -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 <typename AttrKind>
-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,
index d269d89ddba4fa2c5c42f3794932f2b89b156f30..4c78caf034777ecc95f0df7492314c27f6f23f1f 100644 (file)
 using namespace llvm;
 using namespace llvm::codeview;
 
-template <typename T>
-static Error takeObject(ArrayRef<uint8_t> &Data, const T *&Res) {
-  if (Data.size() < sizeof(*Res))
-    return llvm::make_error<CodeViewError>(cv_error_code::insufficient_buffer);
-  Res = reinterpret_cast<const T *>(Data.data());
-  Data = Data.drop_front(sizeof(*Res));
-  return Error::success();
-}
-
 CVSymbolVisitor::CVSymbolVisitor(SymbolVisitorCallbacks &Callbacks)
     : Callbacks(Callbacks) {}
 
index 42751859a47c8b9bba3168c216a7f37e745406fe..893890446b7a96148ea357007b78b8136a8c6160 100644 (file)
@@ -832,28 +832,6 @@ static bool isType(const Metadata *MD) { return !MD || isa<DIType>(MD); }
 static bool isScope(const Metadata *MD) { return !MD || isa<DIScope>(MD); }
 static bool isDINode(const Metadata *MD) { return !MD || isa<DINode>(MD); }
 
-template <class Ty>
-static bool isValidMetadataArrayImpl(const MDTuple &N, bool AllowNull) {
-  for (Metadata *MD : N.operands()) {
-    if (MD) {
-      if (!isa<Ty>(MD))
-        return false;
-    } else {
-      if (!AllowNull)
-        return false;
-    }
-  }
-  return true;
-}
-
-template <class Ty> static bool isValidMetadataArray(const MDTuple &N) {
-  return isValidMetadataArrayImpl<Ty>(N, /* AllowNull */ false);
-}
-
-template <class Ty> static bool isValidMetadataNullArray(const MDTuple &N) {
-  return isValidMetadataArrayImpl<Ty>(N, /* AllowNull */ true);
-}
-
 void Verifier::visitDILocation(const DILocation &N) {
   AssertDI(N.getRawScope() && isa<DILocalScope>(N.getRawScope()),
            "location requires a valid scope", &N, N.getRawScope());
index f2c2aead5a9c49fa93ec2df35ff681d343d491bf..1753d2baaedd2181c72370f1eb6876b4fef164a8 100644 (file)
@@ -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<class T>
-static void advance(T &it, size_t Val) {
-  while (Val--)
-    ++it;
-}
-
 static unsigned getCPUType(const MachOObjectFile &O) {
   return O.getHeader().cputype;
 }
index d150984f882a33aa6dab42a6c0e93c8795c64ab2..1a393845a82244626aff42168b494584b4ff3e2a 100644 (file)
@@ -99,16 +99,6 @@ DEBUG( \
 
 #define INVALIDSCCNUM -1
 
-template<class NodeT>
-void ReverseVector(SmallVectorImpl<NodeT *> &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