[llvm] r232303 - Remove use of a reserved identifier

David Blaikie dblaikie at gmail.com
Mon Mar 16 11:08:50 PDT 2015


On Mon, Mar 16, 2015 at 11:04 AM, Richard Smith <richard at metafoo.co.uk>
wrote:

> On Sat, Mar 14, 2015 at 6:40 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
>> Author: dblaikie
>> Date: Sat Mar 14 20:40:42 2015
>> New Revision: 232303
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=232303&view=rev
>> Log:
>> Remove use of a reserved identifier
>>
>> (& some unnecessary 'inline' keywords, too)
>>
>> Modified:
>>     llvm/trunk/include/llvm/Analysis/ConstantsScanner.h
>>
>> Modified: llvm/trunk/include/llvm/Analysis/ConstantsScanner.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ConstantsScanner.h?rev=232303&r1=232302&r2=232303&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/include/llvm/Analysis/ConstantsScanner.h (original)
>> +++ llvm/trunk/include/llvm/Analysis/ConstantsScanner.h Sat Mar 14
>> 20:40:42 2015
>> @@ -27,37 +27,36 @@ class constant_iterator : public std::it
>>    const_inst_iterator InstI;                // Method instruction
>> iterator
>>    unsigned OpIdx;                           // Operand index
>>
>> -  typedef constant_iterator _Self;
>> -
>> -  inline bool isAtConstant() const {
>> +  bool isAtConstant() const {
>>      assert(!InstI.atEnd() && OpIdx < InstI->getNumOperands() &&
>>             "isAtConstant called with invalid arguments!");
>>      return isa<Constant>(InstI->getOperand(OpIdx));
>>    }
>>
>>  public:
>> -  inline constant_iterator(const Function *F) : InstI(inst_begin(F)),
>> OpIdx(0) {
>> +  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?
>>        operator++();
>>    }
>>
>> -  inline constant_iterator(const Function *F, bool)   // end ctor
>> -    : InstI(inst_end(F)), OpIdx(0) {
>> -  }
>> +  constant_iterator(const Function *F, bool) // end ctor
>> +      : InstI(inst_end(F)),
>> +        OpIdx(0) {}
>>
>> -  inline bool operator==(const _Self& x) const { return OpIdx == x.OpIdx
>> &&
>> -                                                        InstI ==
>> x.InstI; }
>> -  inline bool operator!=(const _Self& x) const { return !operator==(x); }
>> +  bool operator==(const constant_iterator &x) const {
>> +    return OpIdx == x.OpIdx && InstI == x.InstI;
>> +  }
>> +  bool operator!=(const constant_iterator &x) const { return !(*this ==
>> x); }
>>
>> -  inline pointer operator*() const {
>> +  pointer operator*() const {
>>      assert(isAtConstant() && "Dereferenced an iterator at the end!");
>>      return cast<Constant>(InstI->getOperand(OpIdx));
>>    }
>> -  inline pointer operator->() const { return operator*(); }
>> +  pointer operator->() const { return **this; }
>>
>> -  inline _Self& operator++() {   // Preincrement implementation
>> +  constant_iterator &operator++() { // Preincrement implementation
>>      ++OpIdx;
>>      do {
>>        unsigned NumOperands = InstI->getNumOperands();
>> @@ -73,11 +72,13 @@ public:
>>      return *this;  // At the end of the method
>>    }
>>
>> -  inline _Self operator++(int) { // Postincrement
>> -    _Self tmp = *this; ++*this; return tmp;
>> +  onstant_iterator operator++(int) { // Postincrement
>>
>
> Typo "onstant_iterator".
>
> Given that this didn't cause any build breakage (apart from in the modules
> buildbot), can we just delete this file?
>

<3 modules (I really should switch to a modules build... maybe, probably -
though then I might've just fixed the typo without realizing this was dead
code).

It looks like this was rendered dead when we removed the C backend. We
should just delete it. I'll do that in a moment.

- David


>
>
>> +    constant_iterator tmp = *this;
>> +    ++*this;
>> +    return tmp;
>>    }
>>
>> -  inline bool atEnd() const { return InstI.atEnd(); }
>> +  bool atEnd() const { return InstI.atEnd(); }
>>  };
>>
>>  inline constant_iterator constant_begin(const Function *F) {
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150316/ed9953da/attachment.html>


More information about the llvm-commits mailing list