[LLVM, llvm-diff] Question about FunctionDifferenceEngine and DiffConsumer::printValue

Hi all.
I found next code when switch instruction differs:

Engine.logf("right switch has extra case %r") << CaseValue;

Where CaseValue is a ConstantInt object. Looking how logf works I found that it invokes DiffConsumer::printValue method for CaseValue. And here I found that CaseValue itself will never printed. On first look how DiffConsumer::printValue works it seems that for all constants "object numbering" should be printed:

out << '%' << ctxt.RNumbering[V]; // V = CaseValue in our case.
                                   // RNumbering is instance of DenseMap<Value*,unsigned>.

Then I look into DiffConsumer.cpp, ComputeNumbering method that fills RNumbering and LNumbering. Well, numbering computed for function arguments, basic blocks and instructions only.

It means that for Constants "%0" will be printed always. If so, I propose to add case for constants in DiffConsumer::printValue method, that will print constant itself.

Regards,
Stepan.

Patches welcome!

John.

Hi,

Please find the attached patch for review.

-Stepan.

John McCall wrote:

diffeng.patch (957 Bytes)

ping.

-Stepan.

Stepan Dyatkovskiy wrote:

ping.
-Stepan.

Stepan Dyatkovskiy wrote:

Sorry for the delay; committed in r144079.

John.