| 2264 | } |
| 2265 | |
| 2266 | Id Builder::findStructConstant(Id typeId, const std::vector<Id>& comps) |
| 2267 | { |
| 2268 | Instruction* constant = nullptr; |
| 2269 | bool found = false; |
| 2270 | for (int i = 0; i < (int)groupedStructConstants[typeId].size(); ++i) { |
| 2271 | constant = groupedStructConstants[typeId][i]; |
| 2272 | |
| 2273 | // same contents? |
| 2274 | bool mismatch = false; |
| 2275 | for (int op = 0; op < constant->getNumOperands(); ++op) { |
| 2276 | if (constant->getIdOperand(op) != comps[op]) { |
| 2277 | mismatch = true; |
| 2278 | break; |
| 2279 | } |
| 2280 | } |
| 2281 | if (! mismatch) { |
| 2282 | found = true; |
| 2283 | break; |
| 2284 | } |
| 2285 | } |
| 2286 | |
| 2287 | return found ? constant->getResultId() : NoResult; |
| 2288 | } |
| 2289 | |
| 2290 | // Comments in header |
| 2291 | Id Builder::makeCompositeConstant(Id typeId, const std::vector<Id>& members, bool specConstant) |
nothing calls this directly
no test coverage detected