[LLVMdev] Static function definition in "VectorUtils.h"

David Blaikie dblaikie at gmail.com
Fri Jun 19 10:26:23 PDT 2015


On Fri, Jun 19, 2015 at 3:09 AM, Nema, Ashutosh <Ashutosh.Nema at amd.com>
wrote:

>  I was trying to extend “VectorUtils.h”, found all functions are defined
> as static.
> The common problem when we include this and only use few function,
> compiler throw
> warning for unused functions.
>
> i.e.
> >  llvm/include/llvm/Transforms/Utils/VectorUtils.h:102:1: warning:
> >  ‘llvm::Intrinsic::ID llvm::getIntrinsicIDForCall(llvm::CallInst*, const
> llvm::TargetLibraryInfo*)’
> >  defined but not used [-Wunused-function]
> >  getIntrinsicIDForCall(CallInst *CI, const TargetLibraryInfo *TLI) {
> >  ^
>
> Any specific reason, why these function are defined as static ?
>
> If not, can we make these as non-static functions, by moving them to
> separate cpp
> file (i.e. “VectorUtils.cpp”) and keep declaration in header
> (“VectorUtils.h”) ?
>

You can just change them from static to inline (or move them out to an
implementation file if you like). Looks like oversight when this was
originally committed.

- David


>
> Thanks,
> Ashutosh
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150619/eb9ba72f/attachment.html>


More information about the llvm-dev mailing list