#define LLVM_ANALYSIS_SCALAREVOLUTION_H
#include "llvm/Pass.h"
+#include "llvm/Support/DataTypes.h"
#include "llvm/Support/Streams.h"
#include <set>
///
virtual const Type *getType() const = 0;
+ /// getBitWidth - Get the bit width of the type, if it has one, 0 otherwise.
+ ///
+ uint32_t getBitWidth() const;
+
/// replaceSymbolicValuesWithConcrete - If this SCEV internally references
/// the symbolic value "Sym", construct and return a new SCEV that produces
/// the same value, but which uses the concrete value Conc instead of the
/// print - Print out the internal representation of this scalar to the
/// specified stream. This should really only be used for debugging
/// purposes.
- void print(llvm_ostream &OS) const {
- if (OS.stream()) print(*OS.stream());
- }
virtual void print(std::ostream &OS) const = 0;
+ void print(std::ostream *OS) const { if (OS) print(*OS); }
/// dump - This method is used for debugging.
///
void dump() const;
};
- inline llvm_ostream &operator<<(llvm_ostream &OS, const SCEV &S) {
- S.print(OS);
- return OS;
- }
inline std::ostream &operator<<(std::ostream &OS, const SCEV &S) {
S.print(OS);
return OS;
virtual bool isLoopInvariant(const Loop *L) const;
virtual const Type *getType() const;
virtual bool hasComputableLoopEvolution(const Loop *L) const;
- void print(llvm_ostream &OS) const {
- if (OS.stream()) print(*OS.stream());
- }
virtual void print(std::ostream &OS) const;
+ void print(std::ostream *OS) const { if (OS) print(*OS); }
virtual SCEVHandle
replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
const SCEVHandle &Conc) const;
virtual bool runOnFunction(Function &F);
virtual void releaseMemory();
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
- void print(llvm_ostream &OS, const Module* = 0) const {
- if (OS.stream()) print(*OS.stream());
- }
virtual void print(std::ostream &OS, const Module* = 0) const;
+ void print(std::ostream *OS, const Module* M = 0) const {
+ if (OS) print(*OS, M);
+ }
};
}