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

Nema, Ashutosh Ashutosh.Nema at amd.com
Fri Jun 19 03:09:11 PDT 2015


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") ?

Thanks,
Ashutosh


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150619/d5d40ba5/attachment.html>


More information about the llvm-dev mailing list