NoQ added a comment.

Yeah, cleaning up this API would be great - as long as everybody loves to have 
the API broken and rewrite stuff.

If we are to simplify some APIs, i'd definitely start with 
`getAsSymExpr()`/`getAsSymbol()`/`getAsSymbolicExpression()`.

Essentially we only need `getSVal(MR)` because only `MR` can be bound to, while 
other types of `Loc` cannot be bound to. Technically, only (base `MR`, offset) 
pairs can be bound to, but this is "implementation detail" that we're still 
trying to keep that way (even though it leaks like hell everywhere). So i'd 
rather think of the `Loc` overload as of a convenient wrapper (i.e., the user 
receives `Loc` in some `checkLocation` callback, so he wants to put it directly 
into the API to find his binding). And people would still need to operate with 
regions from time to time (eg., construct a sub-region manually when we expect 
it to be there, or strip casts).

Also the overload between `getSVal(Ex, LC)` and `getSVal(R, Ty)`, when they do 
completely different things, seems confusing.


https://reviews.llvm.org/D38801



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to