aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/Local.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/DataStructure/Local.cpp')
-rw-r--r--lib/Analysis/DataStructure/Local.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp
index 456eb2f333..0d6046d13d 100644
--- a/lib/Analysis/DataStructure/Local.cpp
+++ b/lib/Analysis/DataStructure/Local.cpp
@@ -369,12 +369,17 @@ void GraphBuilder::visitCallInst(CallInst &CI) {
/// Handle casts...
void GraphBuilder::visitCastInst(CastInst &CI) {
- if (isPointerType(CI.getType())) {
- if (isPointerType(CI.getOperand(0)->getType()))
+ if (isPointerType(CI.getType()))
+ if (isPointerType(CI.getOperand(0)->getType())) {
+ // Cast one pointer to the other, just act like a copy instruction
setDestTo(CI, getValueDest(*CI.getOperand(0)));
- else
- ; // FIXME: "Other" node
- }
+ } else {
+ // Cast something (floating point, small integer) to a pointer. We need
+ // to track the fact that the node points to SOMETHING, just something we
+ // don't know about. Make an "Unknown" node.
+ //
+ setDestTo(CI, createNode(DSNode::UnknownNode));
+ }
}