@@ -80,20 +80,20 @@ using namespace llvm;
80
80
using namespace clang ;
81
81
using namespace std ;
82
82
83
- static unsigned long long wrapper_serial = 0LL ;
84
- static const string indent_string (" " );
83
+ static unsigned long long gWrapperSerial = 0LL ;
84
+ static const string kIndentString (" " );
85
85
86
- static map<const FunctionDecl *, void *> wrapper_store ;
87
- static map<const Decl *, void *> ctor_wrapper_store ;
88
- static map<const Decl *, void *> dtor_wrapper_store ;
86
+ static map<const FunctionDecl *, void *> gWrapperStore ;
87
+ static map<const Decl *, void *> gCtorWrapperStore ;
88
+ static map<const Decl *, void *> gDtorWrapperStore ;
89
89
90
90
static
91
91
inline
92
92
void
93
93
indent (ostringstream &buf, int indent_level)
94
94
{
95
95
for (int i = 0 ; i < indent_level; ++i) {
96
- buf << indent_string ;
96
+ buf << kIndentString ;
97
97
}
98
98
}
99
99
@@ -285,29 +285,29 @@ void TClingCallFunc::collect_type_info(QualType &QT, ostringstream &typedefbuf,
285
285
string fp_typedef_name;
286
286
{
287
287
ostringstream nm;
288
- nm << " FP" << wrapper_serial ++;
288
+ nm << " FP" << gWrapperSerial ++;
289
289
type_name = nm.str ();
290
290
raw_string_ostream OS (fp_typedef_name);
291
291
QT.print (OS, Policy, type_name);
292
292
OS.flush ();
293
293
}
294
294
for (int i = 0 ; i < indent_level; ++i) {
295
- typedefbuf << indent_string ;
295
+ typedefbuf << kIndentString ;
296
296
}
297
297
typedefbuf << " typedef " << fp_typedef_name << " ;\n " ;
298
298
return ;
299
299
} else if (QT->isMemberPointerType ()) {
300
300
string mp_typedef_name;
301
301
{
302
302
ostringstream nm;
303
- nm << " MP" << wrapper_serial ++;
303
+ nm << " MP" << gWrapperSerial ++;
304
304
type_name = nm.str ();
305
305
raw_string_ostream OS (mp_typedef_name);
306
306
QT.print (OS, Policy, type_name);
307
307
OS.flush ();
308
308
}
309
309
for (int i = 0 ; i < indent_level; ++i) {
310
- typedefbuf << indent_string ;
310
+ typedefbuf << kIndentString ;
311
311
}
312
312
typedefbuf << " typedef " << mp_typedef_name << " ;\n " ;
313
313
return ;
@@ -323,14 +323,14 @@ void TClingCallFunc::collect_type_info(QualType &QT, ostringstream &typedefbuf,
323
323
string ar_typedef_name;
324
324
{
325
325
ostringstream ar;
326
- ar << " AR" << wrapper_serial ++;
326
+ ar << " AR" << gWrapperSerial ++;
327
327
type_name = ar.str ();
328
328
raw_string_ostream OS (ar_typedef_name);
329
329
QT.print (OS, Policy, type_name);
330
330
OS.flush ();
331
331
}
332
332
for (int i = 0 ; i < indent_level; ++i) {
333
- typedefbuf << indent_string ;
333
+ typedefbuf << kIndentString ;
334
334
}
335
335
typedefbuf << " typedef " << ar_typedef_name << " ;\n " ;
336
336
return ;
@@ -365,7 +365,7 @@ void TClingCallFunc::make_narg_ctor(const unsigned N, ostringstream &typedefbuf,
365
365
} else {
366
366
callbuf << " \n " ;
367
367
for (int j = 0 ; j <= indent_level; ++j) {
368
- callbuf << indent_string ;
368
+ callbuf << kIndentString ;
369
369
}
370
370
}
371
371
}
@@ -429,7 +429,7 @@ void TClingCallFunc::make_narg_call(const unsigned N, ostringstream &typedefbuf,
429
429
} else {
430
430
callbuf << " \n " ;
431
431
for (int j = 0 ; j <= indent_level; ++j) {
432
- callbuf << indent_string ;
432
+ callbuf << kIndentString ;
433
433
}
434
434
}
435
435
}
@@ -461,7 +461,7 @@ void TClingCallFunc::make_narg_ctor_with_return(const unsigned N, const string &
461
461
// }
462
462
//
463
463
for (int i = 0 ; i < indent_level; ++i) {
464
- buf << indent_string ;
464
+ buf << kIndentString ;
465
465
}
466
466
buf << " if (ret) {\n " ;
467
467
++indent_level;
@@ -472,7 +472,7 @@ void TClingCallFunc::make_narg_ctor_with_return(const unsigned N, const string &
472
472
// Write the return value assignment part.
473
473
//
474
474
for (int i = 0 ; i < indent_level; ++i) {
475
- callbuf << indent_string ;
475
+ callbuf << kIndentString ;
476
476
}
477
477
callbuf << " (*(" << class_name << " **)ret) = " ;
478
478
//
@@ -484,7 +484,7 @@ void TClingCallFunc::make_narg_ctor_with_return(const unsigned N, const string &
484
484
//
485
485
callbuf << " ;\n " ;
486
486
for (int i = 0 ; i < indent_level; ++i) {
487
- callbuf << indent_string ;
487
+ callbuf << kIndentString ;
488
488
}
489
489
callbuf << " return;\n " ;
490
490
//
@@ -494,31 +494,31 @@ void TClingCallFunc::make_narg_ctor_with_return(const unsigned N, const string &
494
494
}
495
495
--indent_level;
496
496
for (int i = 0 ; i < indent_level; ++i) {
497
- buf << indent_string ;
497
+ buf << kIndentString ;
498
498
}
499
499
buf << " }\n " ;
500
500
for (int i = 0 ; i < indent_level; ++i) {
501
- buf << indent_string ;
501
+ buf << kIndentString ;
502
502
}
503
503
buf << " else {\n " ;
504
504
++indent_level;
505
505
{
506
506
ostringstream typedefbuf;
507
507
ostringstream callbuf;
508
508
for (int i = 0 ; i < indent_level; ++i) {
509
- callbuf << indent_string ;
509
+ callbuf << kIndentString ;
510
510
}
511
511
make_narg_ctor (N, typedefbuf, callbuf, class_name, indent_level);
512
512
callbuf << " ;\n " ;
513
513
for (int i = 0 ; i < indent_level; ++i) {
514
- callbuf << indent_string ;
514
+ callbuf << kIndentString ;
515
515
}
516
516
callbuf << " return;\n " ;
517
517
buf << typedefbuf.str () << callbuf.str ();
518
518
}
519
519
--indent_level;
520
520
for (int i = 0 ; i < indent_level; ++i) {
521
- buf << indent_string ;
521
+ buf << kIndentString ;
522
522
}
523
523
buf << " }\n " ;
524
524
}
@@ -546,18 +546,18 @@ void TClingCallFunc::make_narg_call_with_return(const unsigned N, const string &
546
546
ostringstream typedefbuf;
547
547
ostringstream callbuf;
548
548
for (int i = 0 ; i < indent_level; ++i) {
549
- callbuf << indent_string ;
549
+ callbuf << kIndentString ;
550
550
}
551
551
make_narg_call (N, typedefbuf, callbuf, class_name, indent_level);
552
552
callbuf << " ;\n " ;
553
553
for (int i = 0 ; i < indent_level; ++i) {
554
- callbuf << indent_string ;
554
+ callbuf << kIndentString ;
555
555
}
556
556
callbuf << " return;\n " ;
557
557
buf << typedefbuf.str () << callbuf.str ();
558
558
} else {
559
559
for (int i = 0 ; i < indent_level; ++i) {
560
- buf << indent_string ;
560
+ buf << kIndentString ;
561
561
}
562
562
buf << " if (ret) {\n " ;
563
563
++indent_level;
@@ -568,7 +568,7 @@ void TClingCallFunc::make_narg_call_with_return(const unsigned N, const string &
568
568
// Write the placement part of the placement new.
569
569
//
570
570
for (int i = 0 ; i < indent_level; ++i) {
571
- callbuf << indent_string ;
571
+ callbuf << kIndentString ;
572
572
}
573
573
callbuf << " new (ret) " ;
574
574
string type_name;
@@ -596,7 +596,7 @@ void TClingCallFunc::make_narg_call_with_return(const unsigned N, const string &
596
596
//
597
597
callbuf << " );\n " ;
598
598
for (int i = 0 ; i < indent_level; ++i) {
599
- callbuf << indent_string ;
599
+ callbuf << kIndentString ;
600
600
}
601
601
callbuf << " return;\n " ;
602
602
//
@@ -606,31 +606,31 @@ void TClingCallFunc::make_narg_call_with_return(const unsigned N, const string &
606
606
}
607
607
--indent_level;
608
608
for (int i = 0 ; i < indent_level; ++i) {
609
- buf << indent_string ;
609
+ buf << kIndentString ;
610
610
}
611
611
buf << " }\n " ;
612
612
for (int i = 0 ; i < indent_level; ++i) {
613
- buf << indent_string ;
613
+ buf << kIndentString ;
614
614
}
615
615
buf << " else {\n " ;
616
616
++indent_level;
617
617
{
618
618
ostringstream typedefbuf;
619
619
ostringstream callbuf;
620
620
for (int i = 0 ; i < indent_level; ++i) {
621
- callbuf << indent_string ;
621
+ callbuf << kIndentString ;
622
622
}
623
623
make_narg_call (N, typedefbuf, callbuf, class_name, indent_level);
624
624
callbuf << " ;\n " ;
625
625
for (int i = 0 ; i < indent_level; ++i) {
626
- callbuf << indent_string ;
626
+ callbuf << kIndentString ;
627
627
}
628
628
callbuf << " return;\n " ;
629
629
buf << typedefbuf.str () << callbuf.str ();
630
630
}
631
631
--indent_level;
632
632
for (int i = 0 ; i < indent_level; ++i) {
633
- buf << indent_string ;
633
+ buf << kIndentString ;
634
634
}
635
635
buf << " }\n " ;
636
636
}
@@ -1022,7 +1022,7 @@ tcling_callfunc_Wrapper_t TClingCallFunc::make_wrapper()
1022
1022
// string mn;
1023
1023
// fInterp->maybeMangleDeclName(ND, mn);
1024
1024
// buf << '_' << mn;
1025
- buf << ' _' << wrapper_serial ++;
1025
+ buf << ' _' << gWrapperSerial ++;
1026
1026
wrapper_name = buf.str ();
1027
1027
}
1028
1028
//
@@ -1045,14 +1045,14 @@ tcling_callfunc_Wrapper_t TClingCallFunc::make_wrapper()
1045
1045
// possible number of arguments per call.
1046
1046
for (unsigned N = min_args; N <= num_params; ++N) {
1047
1047
for (int i = 0 ; i < indent_level; ++i) {
1048
- buf << indent_string ;
1048
+ buf << kIndentString ;
1049
1049
}
1050
1050
buf << " if (nargs == " << N << " ) {\n " ;
1051
1051
++indent_level;
1052
1052
make_narg_call_with_return (N, class_name, buf, indent_level);
1053
1053
--indent_level;
1054
1054
for (int i = 0 ; i < indent_level; ++i) {
1055
- buf << indent_string ;
1055
+ buf << kIndentString ;
1056
1056
}
1057
1057
buf << " }\n " ;
1058
1058
}
@@ -1066,7 +1066,7 @@ tcling_callfunc_Wrapper_t TClingCallFunc::make_wrapper()
1066
1066
//
1067
1067
void *F = compile_wrapper (wrapper_name, wrapper);
1068
1068
if (F) {
1069
- wrapper_store .insert (make_pair (FD, F));
1069
+ gWrapperStore .insert (make_pair (FD, F));
1070
1070
} else {
1071
1071
Error (" TClingCallFunc::make_wrapper" ,
1072
1072
" Failed to compile\n ==== SOURCE BEGIN ====\n %s\n ==== SOURCE END ====" ,
@@ -1145,7 +1145,7 @@ tcling_callfunc_ctor_Wrapper_t TClingCallFunc::make_ctor_wrapper(const TClingCla
1145
1145
// string mn;
1146
1146
// fInterp->maybeMangleDeclName(ND, mn);
1147
1147
// buf << '_dtor_' << mn;
1148
- buf << ' _' << wrapper_serial ++;
1148
+ buf << ' _' << gWrapperSerial ++;
1149
1149
wrapper_name = buf.str ();
1150
1150
}
1151
1151
//
@@ -1231,7 +1231,7 @@ tcling_callfunc_ctor_Wrapper_t TClingCallFunc::make_ctor_wrapper(const TClingCla
1231
1231
void *F = compile_wrapper (wrapper_name, wrapper,
1232
1232
/* withAccessControl=*/ false );
1233
1233
if (F) {
1234
- ctor_wrapper_store .insert (make_pair (info->GetDecl (), F));
1234
+ gCtorWrapperStore .insert (make_pair (info->GetDecl (), F));
1235
1235
} else {
1236
1236
Error (" TClingCallFunc::make_ctor_wrapper" ,
1237
1237
" Failed to compile\n ==== SOURCE BEGIN ====\n %s\n ==== SOURCE END ====" ,
@@ -1299,7 +1299,7 @@ TClingCallFunc::make_dtor_wrapper(const TClingClassInfo *info)
1299
1299
// string mn;
1300
1300
// fInterp->maybeMangleDeclName(ND, mn);
1301
1301
// buf << '_dtor_' << mn;
1302
- buf << ' _' << wrapper_serial ++;
1302
+ buf << ' _' << gWrapperSerial ++;
1303
1303
wrapper_name = buf.str ();
1304
1304
}
1305
1305
//
@@ -1395,7 +1395,7 @@ TClingCallFunc::make_dtor_wrapper(const TClingClassInfo *info)
1395
1395
void *F = compile_wrapper (wrapper_name, wrapper,
1396
1396
/* withAccessControl=*/ false );
1397
1397
if (F) {
1398
- dtor_wrapper_store .insert (make_pair (info->GetDecl (), F));
1398
+ gDtorWrapperStore .insert (make_pair (info->GetDecl (), F));
1399
1399
} else {
1400
1400
Error (" TClingCallFunc::make_dtor_wrapper" ,
1401
1401
" Failed to compile\n ==== SOURCE BEGIN ====\n %s\n ==== SOURCE END ====" ,
@@ -2303,8 +2303,8 @@ void *TClingCallFunc::InterfaceMethod()
2303
2303
2304
2304
R__LOCKGUARD (gInterpreterMutex );
2305
2305
const FunctionDecl *decl = fMethod ->GetMethodDecl ();
2306
- map<const FunctionDecl *, void *>::iterator I = wrapper_store .find (decl);
2307
- if (I != wrapper_store .end ()) {
2306
+ map<const FunctionDecl *, void *>::iterator I = gWrapperStore .find (decl);
2307
+ if (I != gWrapperStore .end ()) {
2308
2308
fWrapper = (tcling_callfunc_Wrapper_t) I->second ;
2309
2309
} else {
2310
2310
fWrapper = make_wrapper ();
@@ -2331,8 +2331,8 @@ TInterpreter::CallFuncIFacePtr_t TClingCallFunc::IFacePtr()
2331
2331
2332
2332
const FunctionDecl *decl = fMethod ->GetMethodDecl ();
2333
2333
map<const FunctionDecl *, void *>::iterator I =
2334
- wrapper_store .find (decl);
2335
- if (I != wrapper_store .end ()) {
2334
+ gWrapperStore .find (decl);
2335
+ if (I != gWrapperStore .end ()) {
2336
2336
fWrapper = (tcling_callfunc_Wrapper_t) I->second ;
2337
2337
} else {
2338
2338
fWrapper = make_wrapper ();
0 commit comments