Keep track of references to mem(cpy,move,set) and then print only one extern
[oota-llvm.git] / lib / Target / PIC16 / PIC16.h
index 447beba7d693744260f71ab81d3206d05697ef7b..09453fb3c612c7682cb8627ee3aa41933c1f8f8e 100644 (file)
@@ -255,6 +255,20 @@ namespace PIC16CC {
       return false;
     }
 
+    // FIXME: currently we track both @memcpy and memcpy, as 
+    // the first one is generated by clang, and the second one by codegen
+    // while lowering intrinsics. One we fix codegen to use RTLIB, we can
+    // have only @memcpy here.
+    inline static bool isMemIntrinsic (const std::string &Name) {
+      if (Name.compare("@memcpy") == 0 || Name.compare("memcpy") == 0 ||
+          Name.compare("@memset") == 0 || Name.compare("memset") == 0 ||
+          Name.compare("@memmove") == 0 || Name.compare("memmove") == 0) {
+        return true;
+      }
+      
+      return false;
+    }
+
     inline static bool isLocalToFunc (std::string &Func, std::string &Var) {
       if (! isLocalName(Var)) return false;