From 5f5fd8e5455393ddc74f00e7614e39945f633159 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Mon, 16 Jul 2012 15:42:35 +0000 Subject: [PATCH] Target/AMDGPU/R600KernelParameters.cpp: Don't use "and", "or" as conditional operator... llvm-svn: 160278 --- llvm/lib/Target/AMDGPU/R600KernelParameters.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/R600KernelParameters.cpp b/llvm/lib/Target/AMDGPU/R600KernelParameters.cpp index aee79061c778..cc9f785cae33 100644 --- a/llvm/lib/Target/AMDGPU/R600KernelParameters.cpp +++ b/llvm/lib/Target/AMDGPU/R600KernelParameters.cpp @@ -97,12 +97,12 @@ bool R600KernelParameters::IsOpenCLKernel(const Function* Fun) { Module *Mod = const_cast(Fun)->getParent(); NamedMDNode * MD = Mod->getOrInsertNamedMetadata("opencl.kernels"); - if (!MD or !MD->getNumOperands()) { + if (!MD || !MD->getNumOperands()) { return false; } for (int i = 0; i < int(MD->getNumOperands()); i++) { - if (!MD->getOperand(i) or !MD->getOperand(i)->getOperand(0)) { + if (!MD->getOperand(i) || !MD->getOperand(i)->getOperand(0)) { continue; } @@ -145,7 +145,7 @@ bool R600KernelParameters::IsIndirect(Value *Val, std::set &Visited) { } if (isa(Val->getType())) { - assert(0 and "Internal error"); + assert(0 && "Internal error"); return false; } @@ -187,7 +187,7 @@ void R600KernelParameters::AddParam(Argument *Arg) { P.OffsetInDW = getListSize(); P.SizeInDW = CalculateArgumentSize(Arg); - if (isa(Arg->getType()) and Arg->hasByValAttr()) { + if (isa(Arg->getType()) && Arg->hasByValAttr()) { std::set Visited; P.IsIndirect = IsIndirect(P.Val, Visited); } @@ -198,7 +198,7 @@ void R600KernelParameters::AddParam(Argument *Arg) { int R600KernelParameters::CalculateArgumentSize(Argument *Arg) { Type* T = Arg->getType(); - if (Arg->hasByValAttr() and dyn_cast(T)) { + if (Arg->hasByValAttr() && dyn_cast(T)) { T = dyn_cast(T)->getElementType(); } @@ -254,7 +254,7 @@ void R600KernelParameters::Propagate(Value* V, const Twine& Name, bool IsIndirec Addrspace = AMDILAS::PARAM_D_ADDRESS; } - if (GEP and GEP->getType()->getAddressSpace() != Addrspace) { + if (GEP && GEP->getType()->getAddressSpace() != Addrspace) { Value *Op = GEP->getPointerOperand(); if (dyn_cast(Op->getType())->getAddressSpace() != Addrspace) { @@ -330,7 +330,7 @@ Value* R600KernelParameters::ConstantRead(Function *Fun, Param &P) { Type * ArgType = P.Val->getType(); PointerType * ArgPtrType = dyn_cast(P.Val->getType()); - if (ArgPtrType and Arg->hasByValAttr()) { + if (ArgPtrType && Arg->hasByValAttr()) { Value* ParamAddrSpacePtr = ConstantPointerNull::get( PointerType::get(Type::getInt32Ty(*Context), Addrspace)); @@ -364,7 +364,7 @@ Value* R600KernelParameters::handleSpecial(Function* Fun, Param& P) { assert(!Name.empty()); - if (Name == "image2d_t" or Name == "image3d_t") { + if (Name == "image2d_t" || Name == "image3d_t") { int LastID = std::max(getLastSpecialID("image2d_t"), getLastSpecialID("image3d_t"));