@@ -126,26 +126,6 @@ public struct Constant<Repr: ConstantRepresentation>: IRValue {
126
126
}
127
127
}
128
128
129
- /// Creates a constant negate operation to negate an integral value.
130
- ///
131
- /// - parameter lhs: The operand to negate.
132
- ///
133
- /// - returns: A constant value representing the negation of the given constant.
134
- public static prefix func - ( lhs: Constant < Signed > ) -> Constant < Signed > {
135
- precondition ( lhs. repr == . signed, " Invalid representation " )
136
- return Constant < Signed > ( llvm: LLVMConstNeg ( lhs. llvm) )
137
- }
138
-
139
- /// Creates a constant negate operation to negate a floating value.
140
- ///
141
- /// - parameter lhs: The operand to negate.
142
- ///
143
- /// - returns: A constant value representing the negation of the given constant.
144
- public static prefix func - ( lhs: Constant < Floating > ) -> Constant < Floating > {
145
- precondition ( lhs. repr == . floating, " Invalid representation " )
146
- return Constant < Floating > ( llvm: LLVMConstFNeg ( lhs. llvm) )
147
- }
148
-
149
129
/// Creates a constant add operation to add two homogenous constants together.
150
130
///
151
131
/// - parameter lhs: The first summand value (the augend).
@@ -432,6 +412,26 @@ public struct Constant<Repr: ConstantRepresentation>: IRValue {
432
412
}
433
413
}
434
414
415
+ /// Creates a constant negate operation to negate an integral value.
416
+ ///
417
+ /// - parameter lhs: The operand to negate.
418
+ ///
419
+ /// - returns: A constant value representing the negation of the given constant.
420
+ public prefix func - ( lhs: Constant < Signed > ) -> Constant < Signed > {
421
+ precondition ( lhs. repr == . signed, " Invalid representation " )
422
+ return Constant < Signed > ( llvm: LLVMConstNeg ( lhs. llvm) )
423
+ }
424
+
425
+ /// Creates a constant negate operation to negate a floating value.
426
+ ///
427
+ /// - parameter lhs: The operand to negate.
428
+ ///
429
+ /// - returns: A constant value representing the negation of the given constant.
430
+ public prefix func - ( lhs: Constant < Floating > ) -> Constant < Floating > {
431
+ precondition ( lhs. repr == . floating, " Invalid representation " )
432
+ return Constant < Floating > ( llvm: LLVMConstFNeg ( lhs. llvm) )
433
+ }
434
+
435
435
extension Constant where Repr: IntegralConstantRepresentation {
436
436
// MARK: Logical Operations
437
437
0 commit comments