diff options
author | Craig Topper <craig.topper@gmail.com> | 2012-05-24 04:22:05 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2012-05-24 04:22:05 +0000 |
commit | 6fcf129cf5fcf4cd0ceb2afa8e2537a4333f896d (patch) | |
tree | 0ca5a78dff2c1cbc9d22320eea8edd6d1d6b1776 /lib/Target/NVPTX/NVPTXISelLowering.cpp | |
parent | 032f441afcdd70eb6bda477d32e8c372443b4e6f (diff) | |
download | llvm-6fcf129cf5fcf4cd0ceb2afa8e2537a4333f896d.tar.gz llvm-6fcf129cf5fcf4cd0ceb2afa8e2537a4333f896d.tar.bz2 llvm-6fcf129cf5fcf4cd0ceb2afa8e2537a4333f896d.tar.xz |
Mark a couple arrays as static and const. Use array_lengthof instead of sizeof/sizeof.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157369 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/NVPTX/NVPTXISelLowering.cpp')
-rw-r--r-- | lib/Target/NVPTX/NVPTXISelLowering.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Target/NVPTX/NVPTXISelLowering.cpp b/lib/Target/NVPTX/NVPTXISelLowering.cpp index d326805b22..d517e8117b 100644 --- a/lib/Target/NVPTX/NVPTXISelLowering.cpp +++ b/lib/Target/NVPTX/NVPTXISelLowering.cpp @@ -887,10 +887,10 @@ NVPTXTargetLowering::getParamHelpSymbol(SelectionDAG &DAG, int idx) { // Check to see if the kernel argument is image*_t or sampler_t bool llvm::isImageOrSamplerVal(const Value *arg, const Module *context) { - const char *specialTypes[] = { - "struct._image2d_t", - "struct._image3d_t", - "struct._sampler_t" + static const char *const specialTypes[] = { + "struct._image2d_t", + "struct._image3d_t", + "struct._sampler_t" }; const Type *Ty = arg->getType(); @@ -905,7 +905,7 @@ bool llvm::isImageOrSamplerVal(const Value *arg, const Module *context) { const StructType *STy = dyn_cast<StructType>(PTy->getElementType()); const std::string TypeName = STy ? STy->getName() : ""; - for (int i=0, e=sizeof(specialTypes)/sizeof(specialTypes[0]); i!=e; ++i) + for (int i = 0, e = array_lengthof(specialTypes); i != e; ++i) if (TypeName == specialTypes[i]) return true; |