[llvm-commits] [llvm] r131516 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineCalls.cpp lib/Transforms/InstCombine/InstructionCombining.cpp test/Transforms/InstCombine/call.ll

Frits van Bommel fvbommel at gmail.com
Wed May 18 00:44:19 PDT 2011


On Wed, May 18, 2011 at 3:28 AM, Eli Friedman <eli.friedman at gmail.com> wrote:
> Start trying to make InstCombine preserve more debug info.  The idea here is
> to set the debug location on the IRBuilder, which will be then right
> location in most cases.  This should magically give many transformations
> debug locations, and fixing places which are missing a debug location will
> usually just means changing the code creating it to use the IRBuilder.

>     // Now that we have an instruction, try combining it to simplify it.
>     Builder->SetInsertPoint(I->getParent(), I);
> +    Builder->SetCurrentDebugLocation(I->getDebugLoc());

This would look even nicer if the IRBuilder::SetInsertPoint()
overloads that take an Instruction* did this automatically :).
That would also make the migration of other passes to IRBuilder look cleaner.

IRBuilder users that want a different DebugLoc can always set it manually...




More information about the llvm-commits mailing list