|
10 | 10 | #define LLVM_ANALYSIS_TARGETLIBRARYINFO_H
|
11 | 11 |
|
12 | 12 | #include "llvm/ADT/DenseMap.h"
|
| 13 | +#include "llvm/IR/Constants.h" |
13 | 14 | #include "llvm/IR/InstrTypes.h"
|
| 15 | +#include "llvm/IR/Module.h" |
14 | 16 | #include "llvm/IR/PassManager.h"
|
15 | 17 | #include "llvm/Pass.h"
|
16 | 18 | #include "llvm/TargetParser/Triple.h"
|
|
20 | 22 | namespace llvm {
|
21 | 23 |
|
22 | 24 | template <typename T> class ArrayRef;
|
23 |
| -class ConstantInt; |
24 | 25 |
|
25 | 26 | /// Provides info so a possible vectorization of a function can be
|
26 | 27 | /// computed. Function 'VectorFnName' is equivalent to 'ScalarFnName'
|
@@ -250,12 +251,6 @@ class TargetLibraryInfoImpl {
|
250 | 251 | /// Returns the size of the size_t type in bits.
|
251 | 252 | unsigned getSizeTSize(const Module &M) const;
|
252 | 253 |
|
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 |
| - |
259 | 254 | /// Get size of a C-level int or unsigned int, in bits.
|
260 | 255 | unsigned getIntSize() const {
|
261 | 256 | return SizeOfInt;
|
@@ -572,14 +567,14 @@ class TargetLibraryInfo {
|
572 | 567 | /// \copydoc TargetLibraryInfoImpl::getSizeTSize()
|
573 | 568 | unsigned getSizeTSize(const Module &M) const { return Impl->getSizeTSize(M); }
|
574 | 569 |
|
575 |
| - /// \copydoc TargetLibraryInfoImpl::getSizeTType() |
| 570 | + /// Returns an IntegerType corresponding to size_t. |
576 | 571 | IntegerType *getSizeTType(const Module &M) const {
|
577 |
| - return Impl->getSizeTType(M); |
| 572 | + return IntegerType::get(M.getContext(), getSizeTSize(M)); |
578 | 573 | }
|
579 | 574 |
|
580 |
| - /// \copydoc TargetLibraryInfoImpl::getAsSizeT() |
| 575 | + /// Returns a constant materialized as a size_t type. |
581 | 576 | ConstantInt *getAsSizeT(uint64_t V, const Module &M) const {
|
582 |
| - return Impl->getAsSizeT(V, M); |
| 577 | + return ConstantInt::get(getSizeTType(M), V); |
583 | 578 | }
|
584 | 579 |
|
585 | 580 | /// \copydoc TargetLibraryInfoImpl::getIntSize()
|
|
0 commit comments