| 1875 | } |
| 1876 | |
| 1877 | Id Builder::makeNullConstant(Id typeId) |
| 1878 | { |
| 1879 | Instruction* constant; |
| 1880 | |
| 1881 | // See if we already made it. |
| 1882 | Id existing = NoResult; |
| 1883 | for (int i = 0; i < (int)nullConstants.size(); ++i) { |
| 1884 | constant = nullConstants[i]; |
| 1885 | if (constant->getTypeId() == typeId) |
| 1886 | existing = constant->getResultId(); |
| 1887 | } |
| 1888 | |
| 1889 | if (existing != NoResult) |
| 1890 | return existing; |
| 1891 | |
| 1892 | // Make it |
| 1893 | Instruction* c = new Instruction(getUniqueId(), typeId, Op::OpConstantNull); |
| 1894 | constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(c)); |
| 1895 | nullConstants.push_back(c); |
| 1896 | module.mapInstruction(c); |
| 1897 | |
| 1898 | return c->getResultId(); |
| 1899 | } |
| 1900 | |
| 1901 | Id Builder::makeBoolConstant(bool b, bool specConstant) |
| 1902 | { |
no test coverage detected