Lines Matching refs:std

41 bool validSpirvVersionString(const std::string s) {
54 bool validSpirvVersionStringSpecifier(const std::string s) {
61 bool IsLegacyDoublyEnabledInstruction(const std::string& instruction) {
62 static std::unordered_set<std::string> allowed = {
145 bool EnumValue::IsValid(OperandClass oc, const std::string& context) const
149 std::cerr << "Error: " << context << " " << name << " \"version\" must be set, probably to \"None\"" << std::endl;
152 std::cerr << "Error: " << context << " " << name << " \"version\" is invalid: " << firstVersion << std::endl;
156 std::cerr << "Error: " << context << " " << name << " \"lastVersion\" is invalid: " << lastVersion << std::endl;
180 std::cerr << "Error: " << context << " " << name << " is not usable: "
183 << std::endl;
195 std::cerr << "Error: " << context << " " << name << " is doubly-enabled: "
197 << "Guard it with a capability only." << std::endl;
208 std::cerr << "Error: " << context << " " << name << " is not usable: "
210 << "an extension. Guard it with an extension." << std::endl;
276 std::pair<bool, std::string> ReadFile(const std::string& path)
278 std::ifstream fstream(path, std::ios::in);
280 std::string contents;
281 fstream.seekg(0, std::ios::end);
283 fstream.seekg(0, std::ios::beg);
284 contents.assign((std::istreambuf_iterator<char>(fstream)),
285 std::istreambuf_iterator<char>());
286 return std::make_pair(true, contents);
288 return std::make_pair(false, "");
298 ClassOptionality ToOperandClassAndOptionality(const std::string& operandKind, const std::string& quantifier)
440 std::cerr << "Unhandled operand kind found: " << operandKind << std::endl;
447 bool IsTypeOrResultId(const std::string& str, bool* isType, bool* isResult)
458 unsigned int NumberStringToBit(const std::string& str)
461 unsigned int value = (unsigned int)std::strtol(str.c_str(), &parseEnd, 16);
468 void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders)
480 std::string content;
481 std::tie(fileReadOk, content) = ReadFile(jsonPath);
483 std::cerr << "Failed to read JSON grammar file: "
484 << jsonPath << std::endl;
492 std::cerr << "Failed to parse JSON grammar:\n"
526 std::unordered_set<std::string> tags; // short-lived local for error checking below
532 std::cerr << "Error: each instruction_printing_class requires a non-empty \"tag\"" << std::endl;
533 std::exit(1);
548 std::cerr << "Error: " << inst["opname"].asString()
549 << " requires a non-empty printing \"class\" tag" << std::endl;
550 std::exit(1);
555 std::cerr << "Error: " << inst["opname"].asString()
557 << std::endl;
558 std::exit(1);
561 const std::string name = inst["opname"].asString();
567 std::cerr << "Error: " << name
569 << std::endl;
570 std::exit(1);
576 std::string version = inst["version"].asString();
577 std::string lastVersion = inst["lastVersion"].asString();
583 const std::string kind = operand["kind"].asString();
584 const std::string quantifier = operand.get("quantifier", "").asString();
585 const std::string doc = operand.get("name", "").asString();
592 std::move(EnumValue(opcode, name,
593 std::move(caps), std::move(version), std::move(lastVersion), std::move(exts),
594 std::move(operands))),
608 std::pair<unsigned, bool> result{0u,false};
626 std::tie(value, skip_zero_in_bitfield) = getValue(enumerant);
634 std::cerr << "Error: " << source["kind"] << " enumerant " << enumerant["enumerant"]
636 << " but follows the enumerant with value " << maxValue << std::endl;
637 std::exit(1);
643 std::string version = enumerant["version"].asString();
644 std::string lastVersion = enumerant["lastVersion"].asString();
651 const std::string kind = param["kind"].asString();
652 const std::string doc = param.get("name", "").asString();
659 std::move(caps), std::move(version), std::move(lastVersion), std::move(exts), std::move(params));
664 const std::string& enumName, spv::OperandClass operandClass,
665 spv::EnumValues* enumValues, const Json::Value& operandEnum, const std::string& category) {
669 std::cerr << "Error: container for " << enumName << " operand_kind must not have a version field" << std::endl;
673 const std::string errContext = "enum " + enumName;
684 const std::string enumName = operandEnum["kind"].asString();
685 const std::string category = operandEnum["category"].asString();
784 std::exit(1);