[sledge] Allow global variables as function names

Summary:
Some called functions are represented in llvm as a global variable
with e.g. external linkage, and so they do not appear as
'functions'. It is still valid to call such functions, though the
analyzer does not know their definitions.

Reviewed By: bennostein

Differential Revision: D17725609

fbshipit-source-id: 333d19c0d
master
Josh Berdine 5 years ago committed by Facebook Github Bot
parent 785928c77e
commit ce3252c348

@ -778,7 +778,7 @@ let pp_code fs (insts, term, blocks) =
let rec xlate_func_name x llv = let rec xlate_func_name x llv =
match Llvm.classify_value llv with match Llvm.classify_value llv with
| Function -> Exp.reg (xlate_name x ~global:() llv) | Function | GlobalVariable -> Exp.reg (xlate_name x ~global:() llv)
| ConstantExpr -> xlate_opcode x llv (Llvm.constexpr_opcode llv) | ConstantExpr -> xlate_opcode x llv (Llvm.constexpr_opcode llv)
| Argument | Instruction _ -> xlate_value x llv | Argument | Instruction _ -> xlate_value x llv
| GlobalAlias -> xlate_func_name x (Llvm.operand llv 0) | GlobalAlias -> xlate_func_name x (Llvm.operand llv 0)

Loading…
Cancel
Save