[PGO] Eliminate prof data register calls on FreeBSD platform
[oota-llvm.git] / lib / Transforms / Instrumentation / InstrProfiling.cpp
index a92e7f8297b52ee47b5633f3fb724188834dfd61..a68fd3db6c2e9238ae04bec683a68c38b73f6d1a 100644 (file)
@@ -258,7 +258,9 @@ void InstrProfiling::emitRegistration() {
     return;
 
   // Use linker script magic to get data/cnts/name start/end.
-  if (Triple(M->getTargetTriple()).isOSLinux()) return;
+  if (Triple(M->getTargetTriple()).isOSLinux() ||
+      Triple(M->getTargetTriple()).isOSFreeBSD())
+    return;
 
   // Construct the function.
   auto *VoidTy = Type::getVoidTy(M->getContext());