This is an archive of the discontinued LLVM Phabricator instance.

Code Re-factoring: Implementation moved from "VectorUtils.h" to "VectorUtils.cpp"
ClosedPublic

Authored by ashutosh.nema on Jun 24 2015, 1:28 AM.

Details

Summary

In “VectorUtils.h” all functions are defined as static, common problem is if some module
includes it and only use few functions then compiler throws 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) {
^

In this change I moved these function implementation to a separate file.

Changes in this patch:

  • Moved function definition from “VectorUtils.h” to a separate file “VectorUtils.cpp”
  • Now these functions are non-static.
  • VectorUtils.h is only having declaration for these.

Diff Detail

Repository
rL LLVM

Event Timeline

ashutosh.nema retitled this revision from to Code Re-factoring: Implementation moved from "VectorUtils.h" to "VectorUtils.cpp".
ashutosh.nema updated this object.
ashutosh.nema edited the test plan for this revision. (Show Details)
ashutosh.nema added a reviewer: dblaikie.
ashutosh.nema set the repository for this revision to rL LLVM.
ashutosh.nema added a subscriber: Unknown Object (MLST).
dblaikie accepted this revision.Jun 24 2015, 1:28 PM
dblaikie edited edge metadata.

Looks good - thanks!

(wonder why this wasn't breaking the -Werror build from the day it was checked in... )

This revision is now accepted and ready to land.Jun 24 2015, 1:28 PM

Thanks David for review.

I don’t have check-in permissions, if possible can you please check-in this ?

Regards,
Ashutosh

Could you sync/update this so it applies cleanly to ToT? (makes it easier for me to apply the patch straight from Phab and get the right commit message, etc) - I suspect it's just a silly/minor conflict with the added namespace-ending comment.

ashutosh.nema edited edge metadata.

There was a conflict in namespace ending comment.
Updated changes to use latest version of VectorUtils.h.

This revision was automatically updated to reflect the committed changes.

Arc still had trouble applying this -probably just issues with arc. In any
case, committed in r240794.

Thanks!