[llvm-commits] [llvm] r75445 - in /llvm/trunk: docs/tutorial/ examples/BrainF/ examples/Kaleidoscope/ include/llvm/ include/llvm/CodeGen/ include/llvm/Support/ lib/Analysis/ lib/Analysis/IPA/ lib/CodeGen/ lib/CodeGen/SelectionDAG/ lib/Target/ lib/Target/CBackend/ lib/Target/Mips/ lib/Target/Mips/AsmPrinter/ lib/Target/X86/ lib/Transforms/Scalar/ lib/Transforms/Utils/ lib/VMCore/ tools/bugpoint/ tools/lto/ unittests/ExecutionEngine/JIT/ unittests/Support/

Chris Lattner clattner at apple.com
Mon Jul 13 13:39:13 PDT 2009


On Jul 12, 2009, at 9:09 PM, Owen Anderson wrote:
> Author: resistor
> Date: Sun Jul 12 23:09:18 2009
> New Revision: 75445
>
> URL: http://llvm.org/viewvc/llvm-project?rev=75445&view=rev
> Log:
> Begin the painful process of tearing apart the rat'ss nest that is  
> Constants.cpp and ConstantFold.cpp.
> This involves temporarily hard wiring some parts to use the global  
> context.  This isn't ideal, but it's
> the only way I could figure out to make this process vaguely  
> incremental.

Ok.

> +++ llvm/trunk/include/llvm/Constants.h Sun Jul 12 23:09:18 2009
> @@ -383,7 +380,7 @@
>   /// isString) and it ends in a null byte \0 and does not contains  
> any other
>   /// @endverbatim
>   /// null bytes except its terminator.
> -  bool isCString() const;
> +  bool isCString(LLVMContext &Context) const;

This shouldn't need to take a context.  In it's implementation,  
instead of using "getNullValue" and then doing a pointer comparison  
against it, just check to see if the operand is a null value etc.

> @@ -218,8 +222,8 @@
>   /// isNeg, isFNeg, isNot - Check if the given Value is a
>   /// NEG, FNeg, or NOT instruction.
>   ///
> -  static bool isNeg(const Value *V);
> -  static bool isFNeg(const Value *V);
> +  static bool isNeg(LLVMContext &Context, const Value *V);
> +  static bool isFNeg(LLVMContext &Context, const Value *V);

Likewise, these should not need to take contexts.

-Chris



More information about the llvm-commits mailing list