WIP: interrupt API

This commit is contained in:
Ayke van Laethem
2019-12-15 14:16:22 +01:00
parent 084386262a
commit 9cdc2fa768
18 changed files with 412 additions and 89 deletions
+16
View File
@@ -89,3 +89,19 @@ func typeHasPointers(t llvm.Type) bool {
return false
}
}
// isFunctionLocal returns true if (and only if) this value is local to a
// function. That is, it returns true for instructions and parameters, and false
// for constants and globals.
func isFunctionLocal(val llvm.Value) bool {
if !val.IsAConstant().IsNil() {
return false
}
if !val.IsAInstruction().IsNil() {
return true
}
if !val.IsAGlobalValue().IsNil() {
return false
}
panic("unknown value kind")
}