diff options
author | Dan Gohman <gohman@apple.com> | 2009-12-18 02:58:50 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-12-18 02:58:50 +0000 |
commit | bdc46c6af5ffcf3596a72df75880fe8703436060 (patch) | |
tree | d85a0303352cc1f8bbf93e8e4e1ee1affb7506b7 /include/llvm/Support/ConstantFolder.h | |
parent | 2df72c144164cbb06e505f3af506e1bb69053e73 (diff) |
Add utility routines for creating integer negation operators with NSW set.
Integer negation only overflows with INT_MIN, but that's an important case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91662 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/ConstantFolder.h')
-rw-r--r-- | include/llvm/Support/ConstantFolder.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/llvm/Support/ConstantFolder.h b/include/llvm/Support/ConstantFolder.h index b73cea04ab..eea33dfff6 100644 --- a/include/llvm/Support/ConstantFolder.h +++ b/include/llvm/Support/ConstantFolder.h @@ -109,6 +109,9 @@ public: Constant *CreateNeg(Constant *C) const { return ConstantExpr::getNeg(C); } + Constant *CreateNSWNeg(Constant *C) const { + return ConstantExpr::getNSWNeg(C); + } Constant *CreateFNeg(Constant *C) const { return ConstantExpr::getFNeg(C); } |