diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2015-01-15 11:39:46 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2015-01-15 11:39:46 +0000 |
commit | 8ca43224db45c489cf7bf765d057f3d1a92be92b (patch) | |
tree | 3526b396632e0358095fda441c1bec6cef640f6d /llvm/lib/Analysis/TargetLibraryInfo.cpp | |
parent | be742b745be27611d2080c977de25459aeee947d (diff) | |
download | bcm5719-llvm-8ca43224db45c489cf7bf765d057f3d1a92be92b.tar.gz bcm5719-llvm-8ca43224db45c489cf7bf765d057f3d1a92be92b.zip |
[PM] Port TargetLibraryInfo to the new pass manager, provided by the
TargetLibraryAnalysis pass.
There are actually no direct tests of this already in the tree. I've
added the most basic test that the pass manager bits themselves work,
and the TLI object produced will be tested by an upcoming patches as
they port passes which rely on TLI.
This is starting to point out the awkwardness of the invalidate API --
it seems poorly fitting on the *result* object. I suspect I will change
it to live on the analysis instead, but that's not for this change, and
I'd rather have a few more passes ported in order to have more
experience with how this plays out.
I believe there is only one more analysis required in order to start
porting instcombine. =]
llvm-svn: 226160
Diffstat (limited to 'llvm/lib/Analysis/TargetLibraryInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/TargetLibraryInfo.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp index 1b6ebfa0906..417f570bb6f 100644 --- a/llvm/lib/Analysis/TargetLibraryInfo.cpp +++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp @@ -690,9 +690,28 @@ TargetLibraryInfo::TargetLibraryInfo(const Triple &T) { initialize(*this, T, StandardNames); } -TargetLibraryInfo::TargetLibraryInfo(const TargetLibraryInfo &TLI) { +TargetLibraryInfo::TargetLibraryInfo(const TargetLibraryInfo &TLI) + : CustomNames(TLI.CustomNames) { memcpy(AvailableArray, TLI.AvailableArray, sizeof(AvailableArray)); +} + +TargetLibraryInfo::TargetLibraryInfo(TargetLibraryInfo &&TLI) + : CustomNames(std::move(TLI.CustomNames)) { + std::move(std::begin(TLI.AvailableArray), std::end(TLI.AvailableArray), + AvailableArray); +} + +TargetLibraryInfo &TargetLibraryInfo::operator=(const TargetLibraryInfo &TLI) { CustomNames = TLI.CustomNames; + memcpy(AvailableArray, TLI.AvailableArray, sizeof(AvailableArray)); + return *this; +} + +TargetLibraryInfo &TargetLibraryInfo::operator=(TargetLibraryInfo &&TLI) { + CustomNames = std::move(TLI.CustomNames); + std::move(std::begin(TLI.AvailableArray), std::end(TLI.AvailableArray), + AvailableArray); + return *this; } namespace { @@ -756,6 +775,8 @@ TargetLibraryInfoWrapperPass::TargetLibraryInfoWrapperPass( initializeTargetLibraryInfoWrapperPassPass(*PassRegistry::getPassRegistry()); } +char TargetLibraryAnalysis::PassID; + // Register the basic pass. INITIALIZE_PASS(TargetLibraryInfoWrapperPass, "targetlibinfo", "Target Library Information", false, true) |