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

Nema, Ashutosh Ashutosh.Nema at amd.com
Tue Jun 23 10:05:33 PDT 2015


> 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.

Sure David, I’ll change it.

Thanks,
Ashutosh

From: David Blaikie [mailto:dblaikie at gmail.com]
Sent: Friday, June 19, 2015 10:56 PM
To: Nema, Ashutosh
Cc: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] Static function definition in "VectorUtils.h"



On Fri, Jun 19, 2015 at 3:09 AM, Nema, Ashutosh <Ashutosh.Nema at amd.com<mailto: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<mailto: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/20150623/48b77b89/attachment.html>


More information about the llvm-dev mailing list