[LLVMdev] cygwin build problems

Jay Foad jay.foad at gmail.com
Thu Oct 30 08:57:41 PDT 2008


Cygwin's <stdint.h> defines uint32_t as "unsigned long". I think this
is valid, but it causes various problems like this when building LLVM
with GCC 3.4.4:

.../lib/CodeGen/SelectionDAG/SelectionDAG.cpp:3440: error: call of
overloaded `AddInteger(uint32_t)' is ambiguous

.../lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1429: error: no matching
function for call to `max(long unsigned int, unsigned int&)'

.../include/llvm/ADT/DenseMap.h: In member function `void
llvm::DenseMapIterator<KeyT, ValueT, KeyInfoT,
ValueInfoT>::AdvancePastEmptyBuckets() [with KeyT = uint32_t, ValueT =
llvm::Value*, KeyInfoT = llvm::DenseMapInfo<uint32_t>, ValueInfoT =
llvm::DenseMapInfo<llvm::Value*>]':
.../include/llvm/ADT/DenseMap.h:479:   instantiated from
`llvm::DenseMapIterator<KeyT, ValueT, KeyInfoT, ValueInfoT>&
llvm::DenseMapIterator<KeyT, ValueT, KeyInfoT,
ValueInfoT>::operator++() [with KeyT = uint32_t, ValueT =
llvm::Value*, KeyInfoT = llvm::DenseMapInfo<uint32_t>, ValueInfoT =
llvm::DenseMapInfo<llvm::Value*>]'
.../lib/Transforms/Scalar/GVN.cpp:757:   instantiated from here
.../include/llvm/ADT/DenseMap.h:488: error: `getEmptyKey' is not a
member of `llvm::DenseMapInfo<uint32_t>'
.../include/llvm/ADT/DenseMap.h:489: error: `getTombstoneKey' is not a
member of `llvm::DenseMapInfo<uint32_t>'
.../include/llvm/ADT/DenseMap.h:491: error: `isEqual' is not a member
of `llvm::DenseMapInfo<uint32_t>'
.../include/llvm/ADT/DenseMap.h:491: error: `isEqual' is not a member
of `llvm::DenseMapInfo<uint32_t>'

I've attached a patch to fix these. This allows me to build LLVM on cygwin.

If there's consensus as to whether to use "uint32_t" or "unsigned"
then I could try to fix this more cleanly by using that type
throughout, rather than just adding casts where it causes a problem.

Is this appropriate? If so, can you apply it please?

Thanks,
Jay.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unsigned.patch
Type: application/octet-stream
Size: 9102 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081030/fd08f7c5/attachment.obj>


More information about the llvm-dev mailing list