summaryrefslogtreecommitdiff
path: root/lib/Analysis/TypeBasedAliasAnalysis.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-10-21 19:01:22 +0000
committerDan Gohman <gohman@apple.com>2010-10-21 19:01:22 +0000
commitde38897cfc49f09ffc84fb023a76c076f4b2d402 (patch)
tree6e8755e2412aa30b7a4111eb405749dbd7a4a6a5 /lib/Analysis/TypeBasedAliasAnalysis.cpp
parent1e93466c3a5556db0bd87755e10e2938c2a43c1f (diff)
downloadllvm-de38897cfc49f09ffc84fb023a76c076f4b2d402.tar.gz
llvm-de38897cfc49f09ffc84fb023a76c076f4b2d402.tar.bz2
llvm-de38897cfc49f09ffc84fb023a76c076f4b2d402.tar.xz
Update comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117048 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/TypeBasedAliasAnalysis.cpp')
-rw-r--r--lib/Analysis/TypeBasedAliasAnalysis.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/lib/Analysis/TypeBasedAliasAnalysis.cpp b/lib/Analysis/TypeBasedAliasAnalysis.cpp
index 5994ffd702..1cc743a382 100644
--- a/lib/Analysis/TypeBasedAliasAnalysis.cpp
+++ b/lib/Analysis/TypeBasedAliasAnalysis.cpp
@@ -21,9 +21,29 @@
// This is a work-in-progress. It doesn't work yet, and the metadata
// format isn't stable.
//
-// TODO: getModRefBehavior. The AliasAnalysis infrastructure will need to
-// be extended.
-// TODO: struct fields
+// The current metadata format is very simple. MDNodes have up to three
+// fields, e.g.:
+// !0 = metadata !{ !"name", !1, 0 }
+// The first field is an identity field. It can be any MDString which
+// uniquely identifies the type. The second field identifies the type's
+// parent node in the tree, or is null or omitted for a root node.
+// If the third field is present, it's an integer which if equal to 1
+// indicates that the type is "constant".
+//
+// TODO: The current metadata encoding scheme doesn't support struct
+// fields. For example:
+// struct X {
+// double d;
+// int i;
+// };
+// void foo(struct X *x, struct X *y, double *p) {
+// *x = *y;
+// *p = 0.0;
+// }
+// Struct X has a double member, so the store to *x can alias the store to *p.
+// Currently it's not possible to precisely describe all the things struct X
+// aliases, so struct assignments must use conservative TBAA nodes. There's
+// no scheme for attaching metadata to @llvm.memcpy yet either.
//
//===----------------------------------------------------------------------===//