[llvm-commits] [llvm] r51885 - /llvm/trunk/lib/CodeGen/AsmPrinter.cpp
Dale Johannesen
dalej at apple.com
Mon Jun 2 18:21:17 PDT 2008
This makes the assembly produced for address+constant look like
.long (symbol) + (constant #comment)
Darwin's as actually accepts this, although it whines, but this isn't
right.
On Jun 2, 2008, at 3:19 PM, Scott Michel wrote:
> Author: pingbak
> Date: Mon Jun 2 17:19:12 2008
> New Revision: 51885
>
> URL: http://llvm.org/viewvc/llvm-project?rev=51885&view=rev
> Log:
> Minor cosmetic patch so that the hex equivalent of a decimal
> constant shows up in the assembly language output. Helps with
> debugging without a HP calculator having to be handy.
>
> Modified:
> llvm/trunk/lib/CodeGen/AsmPrinter.cpp
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter.cpp?rev=51885&r1=51884&r2=51885&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter.cpp Mon Jun 2 17:19:12 2008
> @@ -742,7 +742,9 @@
> if (CV->isNullValue() || isa<UndefValue>(CV))
> O << "0";
> else if (const ConstantInt *CI = dyn_cast<ConstantInt>(CV)) {
> - O << CI->getZExtValue();
> + O << CI->getZExtValue() << "\t\t\t"
> + << TAI->getCommentString() << " 0x"
> + << CI->getValue().toStringUnsigned(16);
> } else if (const GlobalValue *GV = dyn_cast<GlobalValue>(CV)) {
> // This is a constant address for a global variable or function.
> Use the
> // name of the variable or function as the address value, possibly
>
>
> _______________________________________________
> 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