Rename getEntryNode -> getEntryBlock()
[oota-llvm.git] / include / llvm / ConstantHandling.h
index 7589bb9a35c6ee36d1f3b8f60a0234ede8bb0eb0..66719cda8e5687294eb87f9e8f171373c432d5e4 100644 (file)
@@ -33,8 +33,6 @@
 #ifndef LLVM_CONSTANTHANDLING_H
 #define LLVM_CONSTANTHANDLING_H
 
-#include <assert.h>
-
 #include "llvm/Constants.h"
 #include "llvm/Type.h"
 class PointerType;
@@ -127,6 +125,12 @@ private:
   ConstRules &operator=(const ConstRules &);  // Do not implement
 };
 
+// Unary operators...
+inline Constant *operator~(const Constant &V) {
+  assert(V.getType()->isIntegral() && "Cannot invert non-intergral constant!");
+  return ConstRules::get(V, V)->op_xor(&V,
+                                    ConstantInt::getAllOnesValue(V.getType()));
+}
 
 // Standard binary operators...
 inline Constant *operator+(const Constant &V1, const Constant &V2) {