I realise that the DataTypes.h.in part might be controversial. Also,
there's probably a better place to put it, but I'm not sure where.
I didn't apply this part. What problems does it cause to not have
this? Can we fix uses of max and min?
I get these errors in lib:
.../lib/Analysis/ValueTracking.cpp:162: error: no matching function
for call to 'min(unsigned int&, uint32_t&)'
.../lib/Analysis/ValueTracking.cpp:163: error: no matching function
for call to 'min(unsigned int&, uint32_t&)'
.../lib/Analysis/ValueTracking.cpp:358: error: no matching function
for call to 'min(unsigned int&, uint32_t)'
.../lib/Analysis/ValueTracking.cpp:469: error: no matching function
for call to 'min(unsigned int&, long unsigned int)'
.../lib/Analysis/ValueTracking.cpp:708: error: no matching function
for call to 'min(unsigned int&, uint32_t)'
.../lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1432: error: no matching
function for call to 'max(long unsigned int, unsigned int&)'
.../lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1747: error: no matching
function for call to 'min(unsigned int&, uint32_t)'
.../lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2033: error: no matching
function for call to 'min(unsigned int&, uint32_t)'
I could try to fix this by changing the code to consistently use
either unsigned or uint32_t (which?), rather than both. Or by adding
casts at the point of calling min/max. What would you prefer?
I'd prefer to avoid uint32_t. I committed a couple patches, can you
try again and let me know if you see any other failures?
lib/Support/APInt.cpp:45: error: prototype for 'void
llvm::APInt::initSlowCase(uint32_t, uint64_t, bool)' does not match
any in class 'llvm::APInt'
lib/Support/APInt.cpp:59: error: prototype for
'llvm::APInt::APInt(uint32_t, uint32_t, const uint64_t*)' does not
match any in class 'llvm::APInt'
lib/Support/APInt.cpp:78: error: prototype for
'llvm::APInt::APInt(uint32_t, const char*, uint32_t, uint8_t)' does
not match any in class 'llvm::APInt'
lib/Support/APInt.cpp:458: error: prototype for 'bool
llvm::APInt::operator(uint32_t) const' does not match any in class
'llvm::APInt'
lib/Support/APInt.cpp:559: error: prototype for 'llvm::APInt&
llvm::APInt::set(uint32_t)' does not match any in class 'llvm::APInt'
lib/Support/APInt.cpp:569: error: prototype for 'llvm::APInt&
llvm::APInt::clear(uint32_t)' does not match any in class
'llvm::APInt'
lib/Support/APInt.cpp:582: error: prototype for 'llvm::APInt&
llvm::APInt::flip(uint32_t)' does not match any in class 'llvm::APInt'
lib/Support/APInt.cpp:589: error: prototype for 'uint32_t
llvm::APInt::getBitsNeeded(const char*, uint32_t, uint8_t)' does not
match any in class 'llvm::APInt'
lib/Support/APInt.cpp:640: error: prototype for 'llvm::APInt
llvm::APInt::getHiBits(uint32_t) const' does not match any in class
'llvm::APInt'
lib/Support/APInt.cpp:645: error: prototype for 'llvm::APInt
llvm::APInt::getLoBits(uint32_t) const' does not match any in class
'llvm::APInt'
lib/Support/APInt.cpp:654: error: prototype for 'uint32_t
llvm::APInt::countLeadingZerosSlowCase() const' does not match any in
class 'llvm::APInt'
lib/Support/APInt.cpp:681: error: prototype for 'uint32_t
llvm::APInt::countLeadingOnes() const' does not match any in class
'llvm::APInt'
lib/Support/APInt.cpp:702: error: prototype for 'uint32_t
llvm::APInt::countTrailingZeros() const' does not match any in class
'llvm::APInt'
lib/Support/APInt.cpp:714: error: prototype for 'uint32_t
llvm::APInt::countTrailingOnesSlowCase() const' does not match any in
class 'llvm::APInt'
lib/Support/APInt.cpp:724: error: prototype for 'uint32_t
llvm::APInt::countPopulationSlowCase() const' does not match any in
class 'llvm::APInt'
lib/Support/APInt.cpp:768: error: 'llvm::APInt
llvm::APIntOps::RoundDoubleToAPInt(double, uint32_t)' should have been
declared inside 'llvm::APIntOps'
lib/Support/APInt.cpp:871: error: prototype for 'llvm::APInt&
llvm::APInt::trunc(uint32_t)' does not match any in class
'llvm::APInt'
lib/Support/APInt.cpp:894: error: prototype for 'llvm::APInt&
llvm::APInt::sext(uint32_t)' does not match any in class 'llvm::APInt'
lib/Support/APInt.cpp:941: error: prototype for 'llvm::APInt&
llvm::APInt::zext(uint32_t)' does not match any in class 'llvm::APInt'
lib/Support/APInt.cpp:960: error: prototype for 'llvm::APInt&
llvm::APInt::zextOrTrunc(uint32_t)' does not match any in class
'llvm::APInt'
lib/Support/APInt.cpp:968: error: prototype for 'llvm::APInt&
llvm::APInt::sextOrTrunc(uint32_t)' does not match any in class
'llvm::APInt'
lib/Support/APInt.cpp:984: error: prototype for 'llvm::APInt
llvm::APInt::ashr(uint32_t) const' does not match any in class
'llvm::APInt'
lib/Support/APInt.cpp:1073: error: prototype for 'llvm::APInt
llvm::APInt::lshr(uint32_t) const' does not match any in class
'llvm::APInt'
lib/Support/APInt.cpp:1140: error: prototype for 'llvm::APInt
llvm::APInt::shlSlowCase(uint32_t) const' does not match any in class
'llvm::APInt'
lib/Support/APInt.cpp:1194: error: prototype for 'llvm::APInt
llvm::APInt::rotl(uint32_t) const' does not match any in class
'llvm::APInt'
lib/Support/APInt.cpp:1209: error: prototype for 'llvm::APInt
llvm::APInt::rotr(uint32_t) const' does not match any in class
'llvm::APInt'
lib/Support/APInt.cpp:1539: error: prototype for 'void
llvm::APInt::divide(llvm::APInt, uint32_t, const llvm::APInt&,
uint32_t, llvm::APInt*, llvm::APInt*)' does not match any in class
'llvm::APInt'
lib/Support/APInt.cpp:1828: error: prototype for 'void
llvm::APInt::fromString(uint32_t, const char*, uint32_t, uint8_t)'
does not match any in class 'llvm::APInt'
lib/Support/APInt.cpp:670: warning: 'uint32_t
countLeadingOnes_64(uint64_t, uint32_t)' defined but not used
lib/Support/APInt.cpp:1359: warning: 'void KnuthDiv(uint32_t*,
uint32_t*, uint32_t*, uint32_t*, uint32_t, uint32_t)' defined but not
used
I can have a go at fixing this - it's probably gonna be hard to do it blind.