summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/ObjCARC/ObjCARCUtil.cpp
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2013-03-26 00:42:09 +0000
committerMichael Gottesman <mgottesman@apple.com>2013-03-26 00:42:09 +0000
commitcd4de0f9bbf1814ac50559b00238976f3963f0c2 (patch)
tree7f4606ac4a9c148f22f36d979583bf9ce6714612 /llvm/lib/Transforms/ObjCARC/ObjCARCUtil.cpp
parent81b1d43783945900865d76d782b43e8dc776387d (diff)
downloadbcm5719-llvm-cd4de0f9bbf1814ac50559b00238976f3963f0c2.tar.gz
bcm5719-llvm-cd4de0f9bbf1814ac50559b00238976f3963f0c2.zip
[ObjCARC Annotations] Added support for displaying the state of pointers at the bottom/top of BBs of the ARC dataflow analysis for both bottomup and topdown analyses.
This will allow for verification and analysis of the merge function of the data flow analyses in the ARC optimizer. The actual implementation of this feature is by introducing calls to the functions llvm.arc.annotation.{bottomup,topdown}.{bbstart,bbend} which are only declared. Each such call takes in a pointer to a global with the same name as the pointer whose provenance is being tracked and a pointer whose name is one of our Sequence states and points to a string that contains the same name. To ensure that the optimizer does not consider these annotations in any way, I made it so that the annotations are considered to be of IC_None type. A test case is included for this commit and the previous ObjCARCAnnotation commit. llvm-svn: 177952
Diffstat (limited to 'llvm/lib/Transforms/ObjCARC/ObjCARCUtil.cpp')
-rw-r--r--llvm/lib/Transforms/ObjCARC/ObjCARCUtil.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/ObjCARC/ObjCARCUtil.cpp b/llvm/lib/Transforms/ObjCARC/ObjCARCUtil.cpp
index 0a54451bb17..03e12d4fd76 100644
--- a/llvm/lib/Transforms/ObjCARC/ObjCARCUtil.cpp
+++ b/llvm/lib/Transforms/ObjCARC/ObjCARCUtil.cpp
@@ -145,6 +145,14 @@ InstructionClass llvm::objcarc::GetFunctionClass(const Function *F) {
return StringSwitch<InstructionClass>(F->getName())
.Case("objc_moveWeak", IC_MoveWeak)
.Case("objc_copyWeak", IC_CopyWeak)
+ // Ignore annotation calls. This is important to stop the
+ // optimizer from treating annotations as uses which would
+ // make the state of the pointers they are attempting to
+ // elucidate to be incorrect.
+ .Case("llvm.arc.annotation.topdown.bbstart", IC_None)
+ .Case("llvm.arc.annotation.topdown.bbend", IC_None)
+ .Case("llvm.arc.annotation.bottomup.bbstart", IC_None)
+ .Case("llvm.arc.annotation.bottomup.bbend", IC_None)
.Default(IC_CallOrUser);
}
OpenPOWER on IntegriCloud