| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*************************************** | ||
| 2 | Auteur : Pierre Aubert | ||
| 3 | Mail : pierre.aubert@lapp.in2p3.fr | ||
| 4 | Licence : CeCILL-C | ||
| 5 | ****************************************/ | ||
| 6 | |||
| 7 | #include "representation.h" | ||
| 8 | |||
| 9 | ///Say if the current function is a function prototype | ||
| 10 | /** @param fct : PFunction | ||
| 11 | * @return true if the function is a function prototype, false otherwise | ||
| 12 | */ | ||
| 13 | 48 | bool repr_isFunction(const PFunction & fct){ | |
| 14 | 48 | return fct.getOtherCode() == ""; | |
| 15 | } | ||
| 16 | |||
| 17 | ///Set a PArchLib | ||
| 18 | /** @param arch : name of the architecture | ||
| 19 | * @param libName : name of the library for the corresponding architecture | ||
| 20 | * @return corresponding PArchLib | ||
| 21 | */ | ||
| 22 | 22 | PArchLib createArchLib(const PString & arch, const PString & libName){ | |
| 23 | 22 | PArchLib archLib; | |
| 24 |
1/1✓ Branch 0 (3→4) taken 22 times.
|
22 | archLib.setArchitecture(arch); |
| 25 |
2/2✓ Branch 0 (4→5) taken 22 times.
✓ Branch 2 (5→6) taken 22 times.
|
22 | archLib.setName(libName); |
| 26 | 22 | return archLib; | |
| 27 | ✗ | } | |
| 28 | |||
| 29 | ///Add a PArchLib in the vector of Architecture if the libName is not empty | ||
| 30 | /** @param[out] vecArch : vector of architecture to be updated | ||
| 31 | * @param arch : name of the architecture | ||
| 32 | * @param libName : name of the library | ||
| 33 | */ | ||
| 34 | 30 | void addArch(PVecArchLib & vecArch, const PString & arch, const PString & libName){ | |
| 35 |
2/2✓ Branch 0 (3→4) taken 22 times.
✓ Branch 1 (3→8) taken 8 times.
|
30 | if(libName != ""){ |
| 36 |
2/2✓ Branch 0 (4→5) taken 22 times.
✓ Branch 2 (5→6) taken 22 times.
|
22 | vecArch.push_back(createArchLib(arch, libName)); |
| 37 | } | ||
| 38 | 30 | } | |
| 39 | |||
| 40 | ///Get the first non empty library file name | ||
| 41 | /** @param vecArch : vector of architecture | ||
| 42 | * @return library file name or empty string if none is found | ||
| 43 | */ | ||
| 44 | 6 | PPath getLibraryFile(const PVecArchLib & vecArch){ | |
| 45 |
2/2✓ Branch 0 (2→3) taken 6 times.
✓ Branch 2 (3→4) taken 6 times.
|
6 | PPath libName(""); |
| 46 | 6 | PVecArchLib::const_iterator it(vecArch.begin()); | |
| 47 |
6/7✓ Branch 0 (21→22) taken 12 times.
✗ Branch 1 (21→25) not taken.
✓ Branch 2 (22→23) taken 12 times.
✓ Branch 4 (23→24) taken 6 times.
✓ Branch 5 (23→25) taken 6 times.
✓ Branch 6 (26→7) taken 6 times.
✓ Branch 7 (26→27) taken 6 times.
|
24 | while(it != vecArch.end() && libName == ""){ |
| 48 |
2/2✓ Branch 0 (9→10) taken 6 times.
✓ Branch 2 (10→11) taken 6 times.
|
6 | libName = it->getName(); |
| 49 | ++it; | ||
| 50 | } | ||
| 51 | 6 | return libName; | |
| 52 | ✗ | } | |
| 53 | |||
| 54 |