suppress warnings about long long arguments
This commit is contained in:
@@ -16,6 +16,11 @@
|
|||||||
#warning "The C++ backend isn't supported when building with LLVM 2.9"
|
#warning "The C++ backend isn't supported when building with LLVM 2.9"
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
#ifndef PRIx64
|
||||||
|
#define PRIx64 "llx"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "llvm/CallingConv.h"
|
#include "llvm/CallingConv.h"
|
||||||
#include "llvm/Constants.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
@@ -1280,7 +1285,7 @@ void CWriter::printConstant(Constant *CPV, bool Static) {
|
|||||||
char Buffer[100];
|
char Buffer[100];
|
||||||
|
|
||||||
uint64_t ll = DoubleToBits(V);
|
uint64_t ll = DoubleToBits(V);
|
||||||
sprintf(Buffer, "0x%llx", static_cast<long long>(ll));
|
sprintf(Buffer, "0x%"PRIx64, static_cast<long long>(ll));
|
||||||
|
|
||||||
std::string Num(&Buffer[0], &Buffer[6]);
|
std::string Num(&Buffer[0], &Buffer[6]);
|
||||||
unsigned long Val = strtoul(Num.c_str(), 0, 16);
|
unsigned long Val = strtoul(Num.c_str(), 0, 16);
|
||||||
|
|||||||
19
expr.cpp
19
expr.cpp
@@ -43,6 +43,13 @@
|
|||||||
#include "module.h"
|
#include "module.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "llvmutil.h"
|
#include "llvmutil.h"
|
||||||
|
#include <inttypes.h>
|
||||||
|
#ifndef PRId64
|
||||||
|
#define PRId64 "lld"
|
||||||
|
#endif
|
||||||
|
#ifndef PRIu64
|
||||||
|
#define PRIu64 "llu"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <set>
|
#include <set>
|
||||||
@@ -4540,18 +4547,10 @@ ConstExpr::Print() const {
|
|||||||
printf("%f", floatVal[i]);
|
printf("%f", floatVal[i]);
|
||||||
break;
|
break;
|
||||||
case AtomicType::TYPE_INT64:
|
case AtomicType::TYPE_INT64:
|
||||||
#ifdef ISPC_IS_LINUX
|
printf("%"PRId64, int64Val[i]);
|
||||||
printf("%ld", int64Val[i]);
|
|
||||||
#else
|
|
||||||
printf("%lld", int64Val[i]);
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case AtomicType::TYPE_UINT64:
|
case AtomicType::TYPE_UINT64:
|
||||||
#ifdef ISPC_IS_LINUX
|
printf("%"PRIu64, uint64Val[i]);
|
||||||
printf("%lu", uint64Val[i]);
|
|
||||||
#else
|
|
||||||
printf("%llu", uint64Val[i]);
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case AtomicType::TYPE_DOUBLE:
|
case AtomicType::TYPE_DOUBLE:
|
||||||
printf("%f", doubleVal[i]);
|
printf("%f", doubleVal[i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user