Skip to content

Commit 945a97a

Browse files
committed
Move functions from Impl onto TLI
1 parent 8cad945 commit 945a97a

File tree

2 files changed

+6
-20
lines changed

2 files changed

+6
-20
lines changed

llvm/include/llvm/Analysis/TargetLibraryInfo.h

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
#define LLVM_ANALYSIS_TARGETLIBRARYINFO_H
1111

1212
#include "llvm/ADT/DenseMap.h"
13+
#include "llvm/IR/Constants.h"
1314
#include "llvm/IR/InstrTypes.h"
15+
#include "llvm/IR/Module.h"
1416
#include "llvm/IR/PassManager.h"
1517
#include "llvm/Pass.h"
1618
#include "llvm/TargetParser/Triple.h"
@@ -20,7 +22,6 @@
2022
namespace llvm {
2123

2224
template <typename T> class ArrayRef;
23-
class ConstantInt;
2425

2526
/// Provides info so a possible vectorization of a function can be
2627
/// computed. Function 'VectorFnName' is equivalent to 'ScalarFnName'
@@ -250,12 +251,6 @@ class TargetLibraryInfoImpl {
250251
/// Returns the size of the size_t type in bits.
251252
unsigned getSizeTSize(const Module &M) const;
252253

253-
/// Returns an IntegerType corresponding to size_t.
254-
IntegerType *getSizeTType(const Module &M) const;
255-
256-
/// Returns a constant materialized as a size_t type.
257-
ConstantInt *getAsSizeT(uint64_t V, const Module &M) const;
258-
259254
/// Get size of a C-level int or unsigned int, in bits.
260255
unsigned getIntSize() const {
261256
return SizeOfInt;
@@ -572,14 +567,14 @@ class TargetLibraryInfo {
572567
/// \copydoc TargetLibraryInfoImpl::getSizeTSize()
573568
unsigned getSizeTSize(const Module &M) const { return Impl->getSizeTSize(M); }
574569

575-
/// \copydoc TargetLibraryInfoImpl::getSizeTType()
570+
/// Returns an IntegerType corresponding to size_t.
576571
IntegerType *getSizeTType(const Module &M) const {
577-
return Impl->getSizeTType(M);
572+
return IntegerType::get(M.getContext(), getSizeTSize(M));
578573
}
579574

580-
/// \copydoc TargetLibraryInfoImpl::getAsSizeT()
575+
/// Returns a constant materialized as a size_t type.
581576
ConstantInt *getAsSizeT(uint64_t V, const Module &M) const {
582-
return Impl->getAsSizeT(V, M);
577+
return ConstantInt::get(getSizeTType(M), V);
583578
}
584579

585580
/// \copydoc TargetLibraryInfoImpl::getIntSize()

llvm/lib/Analysis/TargetLibraryInfo.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,15 +1471,6 @@ unsigned TargetLibraryInfoImpl::getSizeTSize(const Module &M) const {
14711471
return M.getDataLayout().getIndexSizeInBits(AddressSpace);
14721472
}
14731473

1474-
IntegerType *TargetLibraryInfoImpl::getSizeTType(const Module &M) const {
1475-
return IntegerType::get(M.getContext(), getSizeTSize(M));
1476-
}
1477-
1478-
ConstantInt *TargetLibraryInfoImpl::getAsSizeT(uint64_t V,
1479-
const Module &M) const {
1480-
return ConstantInt::get(getSizeTType(M), V);
1481-
}
1482-
14831474
TargetLibraryInfoWrapperPass::TargetLibraryInfoWrapperPass()
14841475
: ImmutablePass(ID), TLA(TargetLibraryInfoImpl()) {
14851476
initializeTargetLibraryInfoWrapperPassPass(*PassRegistry::getPassRegistry());

0 commit comments

Comments
 (0)