[PGO]: Eliminate calls to __llvm_profile_register_function for Linux.
[oota-llvm.git] / lib / Transforms / Instrumentation / InstrProfiling.cpp
index b038d684db21681896594265bb314b22487142b2..a92e7f8297b52ee47b5633f3fb724188834dfd61 100644 (file)
@@ -257,6 +257,9 @@ void InstrProfiling::emitRegistration() {
   if (Triple(M->getTargetTriple()).isOSDarwin())
     return;
 
+  // Use linker script magic to get data/cnts/name start/end.
+  if (Triple(M->getTargetTriple()).isOSLinux()) return;
+
   // Construct the function.
   auto *VoidTy = Type::getVoidTy(M->getContext());
   auto *VoidPtrTy = Type::getInt8PtrTy(M->getContext());