diff -r aa3ce5de5ee8 -r dbda820d4d24 LLVMConstant.st --- a/LLVMConstant.st Wed Oct 07 06:10:55 2015 +0100 +++ b/LLVMConstant.st Mon Oct 12 20:52:13 2015 +0100 @@ -59,6 +59,57 @@ " ! ! +!LLVMConstant class methodsFor:'assertions'! + +assertIsType: type + + + self assert: type isLLVMType message: 'value is not an LLVMType'. + + "Created: / 10-08-2015 / 06:26:37 / Jan Vrany " + "Modified: / 14-09-2015 / 11:09:25 / Jan Vrany " + "Modified (format): / 17-09-2015 / 16:51:34 / Jan Vrany " +! + +assertIsValue: value + + + self assert: value isLLVMValue message: 'value is not an LLVMValue'. + + "Created: / 08-08-2015 / 03:11:16 / Jan Vrany " + "Modified: / 14-09-2015 / 11:09:31 / Jan Vrany " +! + +assertIsValue: value ofKind: kind + + + self assert: value isLLVMValue message: 'value is not an LLVMValue'. + self assert: value type kind = kind message: 'value has incorrect kind' + + "Created: / 10-08-2015 / 17:40:28 / Jan Vrany " + "Modified: / 14-09-2015 / 11:09:34 / Jan Vrany " +! + +assertIsValue: value ofType: type + + + self assert: value isLLVMValue message: 'value is not an LLVMValue'. + self assert: value type = type message: 'value has incorrect type' + + "Created: / 08-08-2015 / 02:49:12 / Jan Vrany " + "Modified: / 14-09-2015 / 11:09:36 / Jan Vrany " +! ! + +!LLVMConstant class methodsFor:'constants - construction'! + +bitcast: value to: type + self assertIsValue: value. + self assertIsType: type. + ^ LLVM ConstBitCast: value _: type. + + "Created: / 12-10-2015 / 16:11:01 / Jan Vrany " +! ! + !LLVMConstant class methodsFor:'constants - int - signed'! sint16:value