Kill every call to @clang.arc.use in the ARC contract phase.
[oota-llvm.git] / lib / Transforms / ObjCARC / ObjCARCContract.cpp
index a9140fb6e73a8253fedf783594d0ccecb9543947..5d0865e8bea2bf6dad3edc05e5c2489437c7640e 100644 (file)
@@ -1,4 +1,4 @@
-//===- ObjCARCOpts.cpp - ObjC ARC Optimization ----------------------------===//
+//===- ObjCARCContract.cpp - ObjC ARC Optimization ------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -11,6 +11,9 @@
 /// Reference Counting and is a system for managing reference counts for objects
 /// in Objective C.
 ///
+/// This specific file mainly deals with ``contracting'' multiple lower level
+/// operations into singular higher level operations through pattern matching.
+///
 /// WARNING: This file knows about certain library functions. It recognizes them
 /// by name, and hardwires knowledge of their semantics.
 ///
@@ -450,6 +453,10 @@ bool ObjCARCContract::runOnFunction(Function &F) {
       if (isa<AllocaInst>(Inst))
         TailOkForStoreStrongs = false;
       continue;
+    case IC_IntrinsicUser:
+      // Remove calls to @clang.arc.use(...).
+      Inst->eraseFromParent();
+      continue;
     default:
       continue;
     }
@@ -532,6 +539,3 @@ bool ObjCARCContract::runOnFunction(Function &F) {
 
   return Changed;
 }
-
-/// @}
-///