Static function definition in "VectorUtils.h"

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

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

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