@@ -145,14 +145,18 @@ bool weave_ns::WeaveCommon::insertAfter(Module &m, Function &f, StringRef &a,
145145 auto &context = m.getContext ();
146146 Type *voidType = Type::getVoidTy (context);
147147 Type *int32Type = Type::getInt32Ty (context);
148- Type *int8PtrType = Type::getInt8PtrTy (context);
148+ #ifdef PERFFLOWASPECT_CLANG_18_NEWER
149+ Type *int8Type = Type::getInt8Ty (context);
150+ #else
151+ Type *int8Type = Type::getInt8PtrTy (context);
152+ #endif
149153 std::vector<llvm::Type *> params;
150154 params.push_back (int32Type);
151- params.push_back (int8PtrType );
152- params.push_back (int8PtrType );
153- params.push_back (int8PtrType );
154- params.push_back (int8PtrType );
155- params.push_back (int8PtrType );
155+ params.push_back (int8Type );
156+ params.push_back (int8Type );
157+ params.push_back (int8Type );
158+ params.push_back (int8Type );
159+ params.push_back (int8Type );
156160
157161 // voidType is return type, params are parameters and no variable length args
158162 FunctionType *weaveFuncTy = FunctionType::get (voidType, params, false );
@@ -198,14 +202,18 @@ bool weave_ns::WeaveCommon::insertBefore(Module &m, Function &f, StringRef &a,
198202 auto &context = m.getContext ();
199203 Type *voidType = Type::getVoidTy (context);
200204 Type *int32Type = Type::getInt32Ty (context);
201- Type *int8PtrType = Type::getInt8PtrTy (context);
205+ #ifdef PERFFLOWASPECT_CLANG_18_NEWER
206+ Type *int8Type = Type::getInt8Ty (context);
207+ #else
208+ Type *int8Type = Type::getInt8PtrTy (context);
209+ #endif
202210 std::vector<llvm::Type *> params;
203211 params.push_back (int32Type);
204- params.push_back (int8PtrType );
205- params.push_back (int8PtrType );
206- params.push_back (int8PtrType );
207- params.push_back (int8PtrType );
208- params.push_back (int8PtrType );
212+ params.push_back (int8Type );
213+ params.push_back (int8Type );
214+ params.push_back (int8Type );
215+ params.push_back (int8Type );
216+ params.push_back (int8Type );
209217
210218 // voidType is return type, params are parameters and no variable length args
211219 FunctionType *weaveFuncTy = FunctionType::get (voidType, params, false );
0 commit comments