[llvm-commits] [llvm] r101299 - /llvm/trunk/include/llvm/IntrinsicInst.h

Dale Johannesen dalej at apple.com
Wed Apr 14 15:27:18 PDT 2010


On Apr 14, 2010, at 3:23 PMPDT, Dan Gohman wrote:

> Author: djg
> Date: Wed Apr 14 17:23:05 2010
> New Revision: 101299
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=101299&view=rev
> Log:
> Remove a const here. This makes this function consistent with all the
> other getOperand wrappers, and it makes it easier to use with DebugInfo
> code, which isn't currently prepared to see const MDNode *.

Please don't do this.  The MDNode is not changing any more by the time we get here, and should be referenced through const*; it's a useful precaution.

> Modified:
>    llvm/trunk/include/llvm/IntrinsicInst.h
> 
> Modified: llvm/trunk/include/llvm/IntrinsicInst.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicInst.h?rev=101299&r1=101298&r2=101299&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/IntrinsicInst.h (original)
> +++ llvm/trunk/include/llvm/IntrinsicInst.h Wed Apr 14 17:23:05 2010
> @@ -105,8 +105,7 @@
>       return cast<ConstantInt>(
>                              const_cast<Value*>(getOperand(2)))->getZExtValue();
>     }
> -    const MDNode *getVariable() const { return cast<MDNode>(getOperand(3)); }
> -    MDNode *getVariable() { return cast<MDNode>(getOperand(3)); }
> +    MDNode *getVariable() const { return cast<MDNode>(getOperand(3)); }
> 
>     // Methods for support type inquiry through isa, cast, and dyn_cast:
>     static inline bool classof(const DbgValueInst *) { return true; }
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list