@@ -154,29 +154,28 @@ CtxInstrumentationLowerer::CtxInstrumentationLowerer(Module &M,
154
154
StartCtx = cast<Function>(
155
155
M.getOrInsertFunction (
156
156
CompilerRtAPINames::StartCtx,
157
- FunctionType::get (ContextNodeTy-> getPointerTo () ,
158
- {ContextRootTy-> getPointerTo () , /* ContextRoot*/
157
+ FunctionType::get (PointerTy ,
158
+ {PointerTy , /* ContextRoot*/
159
159
I64Ty, /* Guid*/ I32Ty,
160
160
/* NumCounters*/ I32Ty /* NumCallsites*/ },
161
161
false ))
162
162
.getCallee ());
163
163
GetCtx = cast<Function>(
164
164
M.getOrInsertFunction (CompilerRtAPINames::GetCtx,
165
- FunctionType::get (ContextNodeTy-> getPointerTo () ,
165
+ FunctionType::get (PointerTy ,
166
166
{PointerTy, /* Callee*/
167
167
I64Ty, /* Guid*/
168
168
I32Ty, /* NumCounters*/
169
169
I32Ty}, /* NumCallsites*/
170
170
false ))
171
171
.getCallee ());
172
172
ReleaseCtx = cast<Function>(
173
- M.getOrInsertFunction (
174
- CompilerRtAPINames::ReleaseCtx,
175
- FunctionType::get (Type::getVoidTy (M.getContext ()),
176
- {
177
- ContextRootTy->getPointerTo (), /* ContextRoot*/
178
- },
179
- false ))
173
+ M.getOrInsertFunction (CompilerRtAPINames::ReleaseCtx,
174
+ FunctionType::get (Type::getVoidTy (M.getContext ()),
175
+ {
176
+ PointerTy, /* ContextRoot*/
177
+ },
178
+ false ))
180
179
.getCallee ());
181
180
182
181
// Declare the TLSes we will need to use.
@@ -264,7 +263,7 @@ bool CtxInstrumentationLowerer::lowerFunction(Function &F) {
264
263
auto *Index = Builder.CreateAnd (CtxAsInt, Builder.getInt64 (1 ));
265
264
// The GEPs corresponding to that index, in the respective TLS.
266
265
ExpectedCalleeTLSAddr = Builder.CreateGEP (
267
- Builder. getInt8Ty ()-> getPointerTo ( ),
266
+ PointerType::getUnqual (F. getContext () ),
268
267
Builder.CreateThreadLocalAddress (ExpectedCalleeTLS), {Index});
269
268
CallsiteInfoTLSAddr = Builder.CreateGEP (
270
269
Builder.getInt32Ty (),
@@ -277,7 +276,7 @@ bool CtxInstrumentationLowerer::lowerFunction(Function &F) {
277
276
// with counters) stays the same.
278
277
RealContext = Builder.CreateIntToPtr (
279
278
Builder.CreateAnd (CtxAsInt, Builder.getInt64 (-2 )),
280
- ThisContextType-> getPointerTo ( ));
279
+ PointerType::getUnqual (F. getContext () ));
281
280
I.eraseFromParent ();
282
281
break ;
283
282
}
0 commit comments