[PGO] Define value profiling updater API signature in InstrProfData.inc (NFC)
[oota-llvm.git] / lib / Transforms / Instrumentation / InstrProfiling.cpp
index 334c41f3abc2287e59b3218c04e38cac0c24894a..a70bf27ed7b91dcc22dc90a087536717f5a77289 100644 (file)
@@ -173,13 +173,14 @@ bool InstrProfiling::runOnModule(Module &M) {
 }
 
 static Constant *getOrInsertValueProfilingCall(Module &M) {
 }
 
 static Constant *getOrInsertValueProfilingCall(Module &M) {
-  auto *VoidTy = Type::getVoidTy(M.getContext());
-  auto *VoidPtrTy = Type::getInt8PtrTy(M.getContext());
-  auto *Int32Ty = Type::getInt32Ty(M.getContext());
-  auto *Int64Ty = Type::getInt64Ty(M.getContext());
-  Type *ArgTypes[] = {Int64Ty, VoidPtrTy, Int32Ty};
+  LLVMContext &Ctx = M.getContext();
+  auto *ReturnTy = Type::getVoidTy(M.getContext());
+  Type *ParamTypes[] = {
+#define VALUE_PROF_FUNC_PARAM(ParamType, ParamName, ParamLLVMType) ParamLLVMType
+#include "llvm/ProfileData/InstrProfData.inc"
+  };
   auto *ValueProfilingCallTy =
   auto *ValueProfilingCallTy =
-      FunctionType::get(VoidTy, makeArrayRef(ArgTypes), false);
+      FunctionType::get(ReturnTy, makeArrayRef(ParamTypes), false);
   return M.getOrInsertFunction("__llvm_profile_instrument_target",
                                ValueProfilingCallTy);
 }
   return M.getOrInsertFunction("__llvm_profile_instrument_target",
                                ValueProfilingCallTy);
 }