@@ -51,7 +51,7 @@ STATISTIC(NumFnWithExactDefinition,
51
51
" Number of functions with exact definitions" );
52
52
STATISTIC (NumFnWithoutExactDefinition,
53
53
" Number of functions without exact definitions" );
54
- STATISTIC (NumFnShallowWrapperCreated , " Number of shallow wrappers created" );
54
+ STATISTIC (NumFnShallowWrappersCreated , " Number of shallow wrappers created" );
55
55
STATISTIC (NumAttributesTimedOut,
56
56
" Number of abstract attributes timed out before fixpoint" );
57
57
STATISTIC (NumAttributesValidFixpoint,
@@ -1415,23 +1415,7 @@ ChangeStatus Attributor::updateAA(AbstractAttribute &AA) {
1415
1415
return CS;
1416
1416
}
1417
1417
1418
- // / Create a shallow wrapper for \p F such that \p F has internal linkage
1419
- // / afterwards. It also sets the original \p F 's name to anonymous
1420
- // /
1421
- // / A wrapper is a function with the same type (and attributes) as \p F
1422
- // / that will only call \p F and return the result, if any.
1423
- // /
1424
- // / Assuming the declaration of looks like:
1425
- // / rty F(aty0 arg0, ..., atyN argN);
1426
- // /
1427
- // / The wrapper will then look as follows:
1428
- // / rty wrapper(aty0 arg0, ..., atyN argN) {
1429
- // / return F(arg0, ..., argN);
1430
- // / }
1431
- // /
1432
- static void createShallowWrapper (Function &F) {
1433
- assert (AllowShallowWrappers &&
1434
- " Cannot create a wrapper if it is not allowed!" );
1418
+ void Attributor::createShallowWrapper (Function &F) {
1435
1419
assert (!F.isDeclaration () && " Cannot create a wrapper around a declaration!" );
1436
1420
1437
1421
Module &M = *F.getParent ();
@@ -1475,7 +1459,7 @@ static void createShallowWrapper(Function &F) {
1475
1459
CI->addAttribute (AttributeList::FunctionIndex, Attribute::NoInline);
1476
1460
ReturnInst::Create (Ctx, CI->getType ()->isVoidTy () ? nullptr : CI, EntryBB);
1477
1461
1478
- NumFnShallowWrapperCreated ++;
1462
+ NumFnShallowWrappersCreated ++;
1479
1463
}
1480
1464
1481
1465
// / Make another copy of the function \p F such that the copied version has
@@ -2279,7 +2263,7 @@ static bool runAttributorOnFunctions(InformationCache &InfoCache,
2279
2263
if (AllowShallowWrappers)
2280
2264
for (Function *F : Functions)
2281
2265
if (!A.isFunctionIPOAmendable (*F))
2282
- createShallowWrapper (*F);
2266
+ Attributor:: createShallowWrapper (*F);
2283
2267
2284
2268
// Internalize non-exact functions
2285
2269
// TODO: for now we eagerly internalize functions without calculating the
0 commit comments