summaryrefslogtreecommitdiff
path: root/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
commit26dbfb6a7882bc8f5d9364b4bec7ef1d339dd327 (patch)
treeb3c67afe6fc3b797f1b9c0ea6cffed20d9261f91 /lib/Transforms/ObjCARC/ObjCARCUtil.cpp
parent7bef073622b95116598f16630c0a9a3265a743a8 (diff)
downloadllvm-26dbfb6a7882bc8f5d9364b4bec7ef1d339dd327.tar.gz
llvm-26dbfb6a7882bc8f5d9364b4bec7ef1d339dd327.tar.bz2
llvm-26dbfb6a7882bc8f5d9364b4bec7ef1d339dd327.tar.xz
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177952 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/ObjCARC/ObjCARCUtil.cpp')
-rw-r--r--lib/Transforms/ObjCARC/ObjCARCUtil.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Transforms/ObjCARC/ObjCARCUtil.cpp b/lib/Transforms/ObjCARC/ObjCARCUtil.cpp
index 0a54451bb1..03e12d4fd7 100644
--- a/lib/Transforms/ObjCARC/ObjCARCUtil.cpp
+++ b/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);
}