From 8e5471e4dac6419ac5d9eac813f51c4b5d95e74d Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Mon, 16 Jul 2012 18:19:38 +0000 Subject: [PATCH] Revert "Target/AMDGPU/R600KernelParameters.cpp: Don't use "and", "or" as conditional operator..." This reverts commit 29f28bc14ad5a907f5dc849f004fafeec0aab33a. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160297 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/AMDGPU/R600KernelParameters.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/Target/AMDGPU/R600KernelParameters.cpp b/lib/Target/AMDGPU/R600KernelParameters.cpp index cc9f785cae3..aee79061c77 100644 --- a/lib/Target/AMDGPU/R600KernelParameters.cpp +++ b/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 || !MD->getNumOperands()) { + if (!MD or !MD->getNumOperands()) { return false; } for (int i = 0; i < int(MD->getNumOperands()); i++) { - if (!MD->getOperand(i) || !MD->getOperand(i)->getOperand(0)) { + if (!MD->getOperand(i) or !MD->getOperand(i)->getOperand(0)) { continue; } @@ -145,7 +145,7 @@ bool R600KernelParameters::IsIndirect(Value *Val, std::set &Visited) { } if (isa(Val->getType())) { - assert(0 && "Internal error"); + assert(0 and "Internal error"); return false; } @@ -187,7 +187,7 @@ void R600KernelParameters::AddParam(Argument *Arg) { P.OffsetInDW = getListSize(); P.SizeInDW = CalculateArgumentSize(Arg); - if (isa(Arg->getType()) && Arg->hasByValAttr()) { + if (isa(Arg->getType()) and 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() && dyn_cast(T)) { + if (Arg->hasByValAttr() and 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 && GEP->getType()->getAddressSpace() != Addrspace) { + if (GEP and 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 && Arg->hasByValAttr()) { + if (ArgPtrType and 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" || Name == "image3d_t") { + if (Name == "image2d_t" or Name == "image3d_t") { int LastID = std::max(getLastSpecialID("image2d_t"), getLastSpecialID("image3d_t")); -- 2.34.1