@@ -131,23 +131,24 @@ end
131
131
132
132
# # call sites and invocations
133
133
134
- # TODO : restrict these to CallBase instructions
134
+ # TODO : add this to the actual type hierarchy
135
+ const CallBase = Union{CallBrInst, CallInst, InvokeInst}
135
136
136
137
export callconv, callconv!,
137
138
istailcall, tailcall!,
138
139
called_value, arguments,
139
140
OperandBundleUse, OperandBundleDef, operand_bundles
140
141
141
- callconv (inst:: Instruction ) = API. LLVMGetInstructionCallConv (inst)
142
- callconv! (inst:: Instruction , cc) =
142
+ callconv (inst:: CallBase ) = API. LLVMGetInstructionCallConv (inst)
143
+ callconv! (inst:: CallBase , cc) =
143
144
API. LLVMSetInstructionCallConv (inst, cc)
144
145
145
- istailcall (inst:: Instruction ) = convert (Core. Bool, API. LLVMIsTailCall (inst))
146
- tailcall! (inst:: Instruction , bool) = API. LLVMSetTailCall (inst, convert (Bool, bool))
146
+ istailcall (inst:: CallBase ) = convert (Core. Bool, API. LLVMIsTailCall (inst))
147
+ tailcall! (inst:: CallBase , bool) = API. LLVMSetTailCall (inst, convert (Bool, bool))
147
148
148
- called_value (inst:: Instruction ) = Value (API. LLVMGetCalledValue (inst))
149
+ called_value (inst:: CallBase ) = Value (API. LLVMGetCalledValue (inst))
149
150
150
- function arguments (inst:: Instruction )
151
+ function arguments (inst:: CallBase )
151
152
nargs = API. LLVMGetNumArgOperands (inst)
152
153
operands (inst)[1 : nargs]
153
154
end
0 commit comments