Add stub version of replaceMachineCodeForFunction. It will live here until
[oota-llvm.git] / include / llvm / ConstantHandling.h
index 2401ad7596b2b5ff7c7e7531bb03a69083844a89..b23566c2095e71b3854469012d5216e5cd8af4b3 100644 (file)
@@ -1,4 +1,4 @@
-//===-- ConstantHandling.h - Stuff for manipulating constants ----*- C++ -*--=//
+//===-- ConstantHandling.h - Stuff for manipulating constants ---*- C++ -*-===//
 //
 // This file contains the declarations of some cool operators that allow you
 // to do natural things with constant pool values.
@@ -125,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) {