[llvm] r316474 - IndirectCallSiteVisitor.h:findIndirectCallSites Don't mark header functions as file-scope static

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 10:29:12 PDT 2017


Author: dblaikie
Date: Tue Oct 24 10:29:12 2017
New Revision: 316474

URL: http://llvm.org/viewvc/llvm-project?rev=316474&view=rev
Log:
IndirectCallSiteVisitor.h:findIndirectCallSites Don't mark header functions as file-scope static

This creates ODR violations if the function is called from another inline                                                                   function in a header and also creates binary bloat from duplicate definitions.

Modified:
    llvm/trunk/include/llvm/Analysis/IndirectCallSiteVisitor.h

Modified: llvm/trunk/include/llvm/Analysis/IndirectCallSiteVisitor.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/IndirectCallSiteVisitor.h?rev=316474&r1=316473&r2=316474&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/IndirectCallSiteVisitor.h (original)
+++ llvm/trunk/include/llvm/Analysis/IndirectCallSiteVisitor.h Tue Oct 24 10:29:12 2017
@@ -27,7 +27,7 @@ struct PGOIndirectCallSiteVisitor
 };
 
 // Helper function that finds all indirect call sites.
-static inline std::vector<Instruction *> findIndirectCallSites(Function &F) {
+inline std::vector<Instruction *> findIndirectCallSites(Function &F) {
   PGOIndirectCallSiteVisitor ICV;
   ICV.visit(F);
   return ICV.IndirectCallInsts;




More information about the llvm-commits mailing list