projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4c9e1d2
)
[CGOpenMPRuntime] emitX86DeclareSimdFunction - assert simdlen/cdtsize is not zero...
author
Simon Pilgrim
<llvm-dev@redking.me.uk>
Wed, 22 May 2019 13:02:19 +0000
(13:02 +0000)
committer
Simon Pilgrim
<llvm-dev@redking.me.uk>
Wed, 22 May 2019 13:02:19 +0000
(13:02 +0000)
Fixes scan-build division by zero warning.
llvm-svn: 361379
clang/lib/CodeGen/CGOpenMPRuntime.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index 0897b4765e22934b10d3b7f71e89938350a1d2f0..651cca4993cee960aed7c9b2de48cdd09c7c788c 100644
(file)
--- a/
clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/
clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@
-9774,8
+9774,9
@@
emitX86DeclareSimdFunction(const FunctionDecl *FD, llvm::Function *Fn,
llvm::raw_svector_ostream Out(Buffer);
Out << "_ZGV" << Data.ISA << Mask;
if (!VLENVal) {
- Out << llvm::APSInt::getUnsigned(Data.VecRegSize /
- evaluateCDTSize(FD, ParamAttrs));
+ unsigned NumElts = evaluateCDTSize(FD, ParamAttrs);
+ assert(NumElts && "Non-zero simdlen/cdtsize expected");
+ Out << llvm::APSInt::getUnsigned(Data.VecRegSize / NumElts);
} else {
Out << VLENVal;
}