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/TargetFolder.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/TargetFolder.h')
-rw-r--r-- | include/llvm/Support/TargetFolder.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/llvm/Support/TargetFolder.h b/include/llvm/Support/TargetFolder.h index afed853e86..9aa762570e 100644 --- a/include/llvm/Support/TargetFolder.h +++ b/include/llvm/Support/TargetFolder.h @@ -122,6 +122,9 @@ public: Constant *CreateNeg(Constant *C) const { return Fold(ConstantExpr::getNeg(C)); } + Constant *CreateNSWNeg(Constant *C) const { + return Fold(ConstantExpr::getNSWNeg(C)); + } Constant *CreateFNeg(Constant *C) const { return Fold(ConstantExpr::getFNeg(C)); } |