X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FAnalysis%2FConstantsScanner.h;h=d3d0a44bd6d4375a026e0c85688b3b6681bae807;hb=11af4b49b2d816a17cd12e2d071ad8bae4aac351;hp=bf0772dbf142f98de332623e27238ebb278064a7;hpb=9769ab22265b313171d201b5928688524a01bd87;p=oota-llvm.git diff --git a/include/llvm/Analysis/ConstantsScanner.h b/include/llvm/Analysis/ConstantsScanner.h index bf0772dbf14..d3d0a44bd6d 100644 --- a/include/llvm/Analysis/ConstantsScanner.h +++ b/include/llvm/Analysis/ConstantsScanner.h @@ -2,13 +2,13 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by the LLVM research group and is distributed under -// the University of Illinois Open Source License. See LICENSE.TXT for details. +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This class implements an iterator to walk through the constants referenced by -// a method. This is used by the Bytecode & Assembly writers to build constant +// a method. This is used by the Bitcode & Assembly writers to build constant // pools. // //===----------------------------------------------------------------------===// @@ -16,15 +16,14 @@ #ifndef LLVM_ANALYSIS_CONSTANTSSCANNER_H #define LLVM_ANALYSIS_CONSTANTSSCANNER_H -#include "llvm/Support/InstIterator.h" -#include "llvm/Instruction.h" -#include "llvm/ADT/iterator" +#include "llvm/IR/InstIterator.h" namespace llvm { class Constant; -class constant_iterator : public forward_iterator { +class constant_iterator : public std::iterator { const_inst_iterator InstI; // Method instruction iterator unsigned OpIdx; // Operand index @@ -32,7 +31,7 @@ class constant_iterator : public forward_iterator { inline bool isAtConstant() const { assert(!InstI.atEnd() && OpIdx < InstI->getNumOperands() && - "isAtConstant called with invalid arguments!"); + "isAtConstant called with invalid arguments!"); return isa(InstI->getOperand(OpIdx)); } @@ -40,7 +39,7 @@ public: inline constant_iterator(const Function *F) : InstI(inst_begin(F)), OpIdx(0) { // Advance to first constant... if we are not already at constant or end if (InstI != inst_end(F) && // InstI is valid? - (InstI->getNumOperands() == 0 || !isAtConstant())) // Not at constant? + (InstI->getNumOperands() == 0 || !isAtConstant())) // Not at constant? operator++(); } @@ -49,7 +48,7 @@ public: } inline bool operator==(const _Self& x) const { return OpIdx == x.OpIdx && - InstI == x.InstI; } + InstI == x.InstI; } inline bool operator!=(const _Self& x) const { return !operator==(x); } inline pointer operator*() const { @@ -63,7 +62,7 @@ public: do { unsigned NumOperands = InstI->getNumOperands(); while (OpIdx < NumOperands && !isAtConstant()) { - ++OpIdx; + ++OpIdx; } if (OpIdx < NumOperands) return *this; // Found a constant!