1 |
|
|
/*************************************** |
2 |
|
|
Auteur : Pierre Aubert |
3 |
|
|
Mail : pierre.aubert@lapp.in2p3.fr |
4 |
|
|
Licence : CeCILL-C |
5 |
|
|
****************************************/ |
6 |
|
|
|
7 |
|
|
#include <map> |
8 |
|
|
#include "pfunc_utils.h" |
9 |
|
|
#include "pfunc_removeConflic.h" |
10 |
|
|
|
11 |
|
|
///Remove the conflict declaration of the functions |
12 |
|
|
/** @param[out] vecOut : output vector of function without conflict |
13 |
|
|
* @param vecIn : input vector of functions to be checked |
14 |
|
|
*/ |
15 |
|
1 |
void pfunc_removeConflict(PVecHeader & vecOut, const PVecHeader & vecIn){ |
16 |
✓ |
1 |
vecOut = vecIn; |
17 |
|
2 |
std::map<std::string, PFunc*> mapFunctionName; |
18 |
✓✓ |
6 |
for(PVecHeader::iterator it(vecOut.begin()); it != vecOut.end(); ++it){ |
19 |
✓ |
5 |
PVecFunc & vecFunc = it->getVecFunc(); |
20 |
✓✓ |
3255 |
for(PVecFunc::iterator itFunc(vecFunc.begin()); itFunc != vecFunc.end(); ++itFunc){ |
21 |
✓✓ |
3250 |
std::string funcName(getPlibIntrinsicsfunction(itFunc->getName())); |
22 |
✓✓ |
3250 |
if(funcName == ""){continue;} //It is a macro |
23 |
✓✓✓ |
2204 |
if(mapFunctionName.find(funcName) != mapFunctionName.end()){ |
24 |
✓✓✓✓
|
48 |
std::cerr << "pfunc_removeConflict : conflict with function '"<<funcName<<"'" << std::endl; |
25 |
✓ |
48 |
itFunc->setNoReplace(true); |
26 |
✓✓ |
48 |
mapFunctionName[funcName]->setNoReplace(true); |
27 |
|
|
}else{ |
28 |
✓ |
2156 |
itFunc->setNoReplace(false); |
29 |
✓ |
2156 |
mapFunctionName[funcName] = itFunc.base(); |
30 |
|
|
} |
31 |
|
|
} |
32 |
|
5 |
mapFunctionName.clear(); |
33 |
|
|
} |
34 |
|
1 |
} |
35 |
|
|
|
36 |
|
|
|