[llvm-commits] [llvm] r77579 - in /llvm/trunk/lib: 'Twine' errors in Transforms/Utils/PromoteMemoryToRegister.cpp Transforms/Scalar/ScalarReplAggregates.cpp on Cygwin

Daniel Dunbar daniel at zuster.org
Thu Jul 30 14:15:42 PDT 2009


Hi Aaron,

I think this should be fixed as of 77624, please let me know if not.

 - Daniel

On Thu, Jul 30, 2009 at 8:57 AM, Aaron
Gray<aaronngray.lists at googlemail.com> wrote:
> 2009/7/30 Daniel Dunbar <daniel at zuster.org>
>>
>> Author: ddunbar
>> Date: Wed Jul 29 23:20:37 2009
>> New Revision: 77579
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=77579&view=rev
>> Log:
>> Switch obvious clients to Twine instead of utostr (when they were already
>> using
>> a Twine, e.g., for names).
>>  - I am a little ambivalent about this; we don't want the string
>> conversion of
>>   utostr, but using overload '+' mixed with string and integer arguments
>> is
>>   sketchy. On the other hand, this particular usage is something of an
>> idiom.
>
>
> Daniel,
>
> I am getting the following error on Cygwin using GCC 4.2.2 :-
>
> ~~~~~~~~~~~~~~~~~
> llvm[3]: Compiling PromoteMemoryToRegister.cpp for Debug build
> /home/ang/svn/llvm-coff/lib/Transforms/Utils/PromoteMemoryToRegister.cpp: In
> mem
> ber function 'bool<unnamed>::PromoteMem2Reg::QueuePhiNode(llvm::BasicBlock*,
> uns
> igned int, unsigned int&, llvm::SmallPtrSet<llvm::PHINode*, 16u>&)':
> /home/ang/svn/llvm-coff/lib/Transforms/Utils/PromoteMemoryToRegister.cpp:870:
> er
> ror: conversion from 'unsigned int' to 'const llvm::Twine' is ambiguous
> /home/ang/svn/llvm-coff/include/llvm/ADT/Twine.h:270: note: candidates are:
> llvm
> ::Twine::Twine(const int64_t&)
> /home/ang/svn/llvm-coff/include/llvm/ADT/Twine.h:265: note:
> llvm::Twine::Twine(
> const uint64_t&)
> /home/ang/svn/llvm-coff/include/llvm/ADT/Twine.h:260: note:
> llvm::Twine::Twine(
> const int32_t&)
> /home/ang/svn/llvm-coff/include/llvm/ADT/Twine.h:255: note:
> llvm::Twine::Twine(
> const uint32_t&)
> make[3]: ***
> [/home/ang/build/llvm-coff/lib/Transforms/Utils/Debug/PromoteMemory
> ToRegister.o] Error 1
> make[3]: Leaving directory `/home/ang/build/llvm-coff/lib/Transforms/Utils'
> make[2]: *** [Utils/.makeall] Error 2
> make[2]: Leaving directory `/home/ang/build/llvm-coff/lib/Transforms'
> make[1]: *** [Transforms/.makeall] Error 2
> make[1]: Leaving directory `/home/ang/build/llvm-coff/lib'
> make: *** [all] Error 1
> ~~~~~~~~~~~~~~~~~~
>
> Its working fine on MSVC 2008, but Cygwin GCC 4.2.2 is failing to resolve
> the typing here.
>
> Transforms/Utils/PromoteMemoryToRegister.cpp
>
> I had to hack it with :-
>
>   PN = PHINode::Create(Allocas[AllocaNo]->getAllocatedType(),
>                        Allocas[AllocaNo]->getName() + "." +
> Twine((uint32_t)Version++),
>                        BB->begin());
>
>     To get it to compile on Cygwin, maybe 'Version' should be a uint32_t ?
>
> Transforms/Scalar/ScalarReplAggregates.cpp
> Transforms/IPO/ArgumentPromotion.cpp
> Transforms/IPO/GlobalOpt.cpp
>     Twine constructors and uint32_t types or casts.
>
> I have done a patch but its a bit insane tab wise it seems to be removing
> all tabs from blank lines.
>
> Also the actual logic I have used is a "just get it working logic", so
> beware :)
>
> Aaron
>




More information about the llvm-commits mailing list