[llvm-commits] [llvm] r158928 - /llvm/trunk/lib/Analysis/MemoryBuiltins.cpp
Nuno Lopes
nunoplopes at sapo.pt
Thu Jun 21 11:38:26 PDT 2012
Author: nlopes
Date: Thu Jun 21 13:38:26 2012
New Revision: 158928
URL: http://llvm.org/viewvc/llvm-project?rev=158928&view=rev
Log:
fix build in C++11 mode.
Thanks to Chandler for pointing out the problem.
Modified:
llvm/trunk/lib/Analysis/MemoryBuiltins.cpp
Modified: llvm/trunk/lib/Analysis/MemoryBuiltins.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryBuiltins.cpp?rev=158928&r1=158927&r2=158928&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/MemoryBuiltins.cpp (original)
+++ llvm/trunk/lib/Analysis/MemoryBuiltins.cpp Thu Jun 21 13:38:26 2012
@@ -43,7 +43,7 @@
AllocType AllocTy;
unsigned char NumParams;
// First and Second size parameters (or -1 if unused)
- unsigned char FstParam, SndParam;
+ signed char FstParam, SndParam;
};
static const AllocFnsTy AllocationFnData[] = {
@@ -100,16 +100,16 @@
// Check function prototype.
// FIXME: Check the nobuiltin metadata?? (PR5130)
- unsigned FstParam = FnData->FstParam;
- unsigned SndParam = FnData->SndParam;
+ int FstParam = FnData->FstParam;
+ int SndParam = FnData->SndParam;
FunctionType *FTy = Callee->getFunctionType();
if (FTy->getReturnType() == Type::getInt8PtrTy(FTy->getContext()) &&
FTy->getNumParams() == FnData->NumParams &&
- (FstParam == (unsigned char)-1 ||
+ (FstParam < 0 ||
(FTy->getParamType(FstParam)->isIntegerTy(32) ||
FTy->getParamType(FstParam)->isIntegerTy(64))) &&
- (SndParam == (unsigned char)-1 ||
+ (SndParam < 0 ||
FTy->getParamType(SndParam)->isIntegerTy(32) ||
FTy->getParamType(SndParam)->isIntegerTy(64)))
return FnData;
@@ -421,7 +421,7 @@
APInt Size = Arg->getValue().zextOrSelf(IntTyBits);
// size determined by just 1 parameter
- if (FnData->SndParam == (unsigned char)-1)
+ if (FnData->SndParam < 0)
return std::make_pair(Size, Zero);
Arg = dyn_cast<ConstantInt>(CS.getArgument(FnData->SndParam));
@@ -604,7 +604,7 @@
Value *FirstArg = CS.getArgument(FnData->FstParam);
FirstArg = Builder.CreateZExt(FirstArg, IntTy);
- if (FnData->SndParam == (unsigned char)-1)
+ if (FnData->SndParam < 0)
return std::make_pair(FirstArg, Zero);
Value *SecondArg = CS.getArgument(FnData->SndParam);
More information about the llvm-commits
mailing list