Home | History | Annotate | Download | only in AsmParser

Lines Matching refs:Name

147                  "expected function name in blockaddress");
229 // The Global variable production with no name can have many different
345 if (ParseToken(lltok::equal, "expected '=' after name") ||
368 std::string Name = Lex.getStrVal();
372 if (ParseToken(lltok::equal, "expected '=' after name") ||
373 ParseToken(lltok::kw_type, "expected 'type' after name"))
377 if (ParseStructDefinition(NameLoc, Name,
378 NamedTypes[Name], Result)) return true;
381 std::pair<Type*, LocTy> &Entry = NamedTypes[Name];
439 std::string Name;
449 if (ParseToken(lltok::equal, "expected '=' after name"))
465 return ParseGlobal(Name, NameLoc, Linkage, HasLinkage, Visibility,
467 return ParseAlias(Name, NameLoc, Linkage, Visibility, DLLStorageClass, TLM,
478 std::string Name = Lex.getStrVal();
494 return ParseGlobal(Name, NameLoc, Linkage, HasLinkage, Visibility,
497 return ParseAlias(Name, NameLoc, Linkage, Visibility, DLLStorageClass, TLM,
503 std::string Name = Lex.getStrVal();
537 Module::ComdatSymTabType::iterator I = ComdatSymTab.find(Name);
538 if (I != ComdatSymTab.end() && !ForwardRefComdats.erase(Name))
539 return Error(NameLoc, "redefinition of comdat '$" + Name + "'");
545 C = M->getOrInsertComdat(Name);
588 std::string Name = Lex.getStrVal();
596 NamedMDNode *NMD = M->getOrInsertNamedMetadata(Name);
665 bool LLParser::ParseAlias(const std::string &Name, LocTy NameLoc, unsigned L,
720 if (!Name.empty()) {
721 GVal = M->getNamedValue(Name);
723 if (!ForwardRefVals.erase(Name))
724 return Error(NameLoc, "redefinition of global '@" + Name + "'");
737 Name, Aliasee, /*Parent*/ nullptr));
743 if (Name.empty())
759 // Insert into the module, we know its name won't collide now.
761 assert(GA->getName() == Name && "Should not be a name conflict!");
780 bool LLParser::ParseGlobal(const std::string &Name, LocTy NameLoc,
818 if (!Name.empty()) {
819 GVal = M->getNamedValue(Name);
821 if (!ForwardRefVals.erase(Name))
822 return Error(NameLoc, "redefinition of global '@" + Name + "'");
835 Name, nullptr, GlobalVariable::NotThreadLocal,
848 if (Name.empty())
877 if (parseOptionalComdat(Name, C))
1068 const std::string &Name) {
1070 return Function::Create(FT, GlobalValue::ExternalWeakLinkage, Name, M);
1073 GlobalValue::ExternalWeakLinkage, nullptr, Name,
1078 /// GetGlobalVal - Get a value with the specified name or ID, creating a
1081 GlobalValue *LLParser::GetGlobalVal(const std::string &Name, Type *Ty,
1089 // Look this name up in the normal function symbol table.
1091 cast_or_null<GlobalValue>(M->getValueSymbolTable().lookup(Name));
1096 auto I = ForwardRefVals.find(Name);
1104 Error(Loc, "'@" + Name + "' defined with type '" +
1110 GlobalValue *FwdVal = createGlobalFwdRef(M, PTy, Name);
1111 ForwardRefVals[Name] = std::make_pair(FwdVal, Loc);
1151 Comdat *LLParser::getComdat(const std::string &Name, LocTy Loc) {
1152 // Look this name up in the comdat symbol table.
1154 Module::ComdatSymTabType::iterator I = ComdatSymTab.find(Name);
1159 Comdat *C = M->getOrInsertComdat(Name);
1160 ForwardRefComdats[Name] = Loc;
1600 std::string Name = Lex.getStrVal();
1601 Kind = M->getMDKindID(Name);
2045 std::string Name;
2054 Name = Lex.getStrVal();
2064 std::move(Name));
2081 Name = Lex.getStrVal();
2084 Name = "";
2093 std::move(Name));
2115 if (!ArgList[i].Name.empty())
2116 return Error(ArgList[i].Loc, "argument name invalid in function type");
2141 bool LLParser::ParseStructDefinition(SMLoc TypeLoc, StringRef Name,
2156 Entry.first = StructType::create(Context, Name);
2182 Entry.first = StructType::create(Context, Name);
2320 /// GetVal - Get a value with the specified name or ID, creating a
2323 Value *LLParser::PerFunctionState::GetVal(const std::string &Name, Type *Ty,
2325 // Look this name up in the normal function symbol table.
2326 Value *Val = F.getValueSymbolTable().lookup(Name);
2331 auto I = ForwardRefVals.find(Name);
2340 P.Error(Loc, "'%" + Name + "' is not a basic block");
2342 P.Error(Loc, "'%" + Name + "' defined with type '" +
2356 FwdVal = BasicBlock::Create(F.getContext(), Name, &F);
2358 FwdVal = new Argument(Ty, Name);
2361 ForwardRefVals[Name] = std::make_pair(FwdVal, Loc);
2366 // Look this name up in the normal function symbol table.
2406 /// basic block, this installs its name.
2410 // If this instruction has void type, it cannot have a name or ID specified.
2413 return P.Error(NameLoc, "instructions returning void cannot have a name");
2420 // If neither a name nor an ID was specified, just use the next ID.
2444 // Otherwise, the instruction had a name. Resolve forward refs and set it.
2457 // Set the name on the instruction.
2466 /// GetBB - Get a basic block with the specified name or ID, creating a
2468 BasicBlock *LLParser::PerFunctionState::GetBB(const std::string &Name,
2470 return dyn_cast_or_null<BasicBlock>(GetVal(Name,
2482 BasicBlock *LLParser::PerFunctionState::DefineBB(const std::string &Name,
2485 if (Name.empty())
2488 BB = GetBB(Name, Loc);
2496 if (Name.empty()) {
2501 ForwardRefVals.erase(Name);
2691 return Error(Fn.Loc, "expected function name in blockaddress");
2693 return Error(Label.Loc, "expected basic block name in blockaddress");
2707 return Error(Fn.Loc, "expected function name in blockaddress");
3258 bool LLParser::ParseMDField(LocTy Loc, StringRef Name,
3265 return TokError("value for '" + Name + "' too large, limit is " +
3274 bool LLParser::ParseMDField(LocTy Loc, StringRef Name, LineField &Result) {
3275 return ParseMDField(Loc, Name, static_cast<MDUnsignedField &>(Result));
3278 bool LLParser::ParseMDField(LocTy Loc, StringRef Name, ColumnField &Result) {
3279 return ParseMDField(Loc, Name, static_cast<MDUnsignedField &>(Result));
3283 bool LLParser::ParseMDField(LocTy Loc, StringRef Name, DwarfTagField &Result) {
3285 return ParseMDField(Loc, Name, static_cast<MDUnsignedField &>(Result));
3301 bool LLParser::ParseMDField(LocTy Loc, StringRef Name,
3304 return ParseMDField(Loc, Name, static_cast<MDUnsignedField &>(Result));
3321 bool LLParser::ParseMDField(LocTy Loc, StringRef Name,
3324 return ParseMDField(Loc, Name, static_cast<MDUnsignedField &>(Result));
3340 bool LLParser::ParseMDField(LocTy Loc, StringRef Name, DwarfLangField &Result) {
3342 return ParseMDField(Loc, Name, static_cast<MDUnsignedField &>(Result));
3358 bool LLParser::ParseMDField(LocTy Loc, StringRef Name,
3361 return ParseMDField(Loc, Name, static_cast<MDUnsignedField &>(Result));
3381 bool LLParser::ParseMDField(LocTy Loc, StringRef Name, DIFlagField &Result) {
3414 bool LLParser::ParseMDField(LocTy Loc, StringRef Name,
3421 return TokError("value for '" + Name + "' too small, limit is " +
3424 return TokError("value for '" + Name + "' too large, limit is " +
3434 bool LLParser::ParseMDField(LocTy Loc, StringRef Name, MDBoolField &Result) {
3450 bool LLParser::ParseMDField(LocTy Loc, StringRef Name, MDField &Result) {
3453 return TokError("'" + Name + "' cannot be null");
3468 bool LLParser::ParseMDField(LocTy Loc, StringRef Name, MDConstant &Result) {
3478 bool LLParser::ParseMDField(LocTy Loc, StringRef Name, MDStringField &Result) {
3485 return Error(ValueLoc, "'" + Name + "' cannot be empty");
3492 bool LLParser::ParseMDField(LocTy Loc, StringRef Name, MDFieldList &Result) {
3518 assert(Lex.getKind() == lltok::MetadataVar && "Expected metadata type name");
3532 bool LLParser::ParseMDField(StringRef Name, FieldTy &Result) {
3534 return TokError("field '" + Name + "' cannot be specified more than once");
3538 return ParseMDField(Loc, Name, Result);
3542 assert(Lex.getKind() == lltok::MetadataVar && "Expected metadata type name");
3552 #define DECLARE_FIELD(NAME, TYPE, INIT) TYPE NAME INIT
3553 #define NOP_FIELD(NAME, TYPE, INIT)
3554 #define REQUIRE_FIELD(NAME, TYPE, INIT) \
3555 if (!NAME.Seen) \
3556 return Error(ClosingLoc, "missing required field '" #NAME "'");
3557 #define PARSE_MD_FIELD(NAME, TYPE, DEFAULT) \
3558 if (Lex.getStrVal() == #NAME) \
3559 return ParseMDField(#NAME, NAME);
3619 /// ::= !DIEnumerator(value: 30, name: "SomeKind")
3622 REQUIRED(name, MDStringField, ); \
3627 Result = GET_OR_DISTINCT(DIEnumerator, (Context, value.Val, name.Val));
3632 /// ::= !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32)
3636 OPTIONAL(name, MDStringField, ); \
3643 Result = GET_OR_DISTINCT(DIBasicType, (Context, tag.Val, name.Val, size.Val,
3649 /// ::= !DIDerivedType(tag: DW_TAG_pointer_type, name: "int", file: !0,
3655 OPTIONAL(name, MDStringField, ); \
3669 (Context, tag.Val, name.Val, file.Val, line.Val,
3678 OPTIONAL(name, MDStringField, ); \
3697 (Context, tag.Val, name.Val, file.Val, line.Val, scope.Val, baseType.Val,
3765 /// ::= !DISubprogram(scope: !0, name: "foo", linkageName: "_Zfoo",
3776 OPTIONAL(name, MDStringField, ); \
3802 (Context, scope.Val, name.Val, linkageName.Val, file.Val, line.Val,
3841 /// ::= !DINamespace(scope: !0, file: !2, name: "SomeNamespace", line: 9)
3846 OPTIONAL(name, MDStringField, ); \
3852 (Context, scope.Val, file.Val, name.Val, line.Val));
3857 /// ::= !DIMacro(macinfo: type, line: 9, name: "SomeMacro", value: "SomeValue")
3862 REQUIRED(name, MDStringField, ); \
3868 (Context, type.Val, line.Val, name.Val, value.Val));
3890 /// ::= !DIModule(scope: !0, name: "SomeModule", configMacros: "-DNDEBUG",
3895 REQUIRED(name, MDStringField, ); \
3902 Result = GET_OR_DISTINCT(DIModule, (Context, scope.Val, name.Val,
3908 /// ::= !DITemplateTypeParameter(name: "Ty", type: !1)
3911 OPTIONAL(name, MDStringField, ); \
3917 GET_OR_DISTINCT(DITemplateTypeParameter, (Context, name.Val, type.Val));
3923 /// name: "V", type: !1, value: i32 7)
3927 OPTIONAL(name, MDStringField, ); \
3934 (Context, tag.Val, name.Val, type.Val, value.Val));
3939 /// ::= !DIGlobalVariable(scope: !0, name: "foo", linkageName: "foo",
3945 REQUIRED(name, MDStringField, (/* AllowEmpty */ false)); \
3959 (Context, scope.Val, name.Val, linkageName.Val,
3966 /// ::= !DILocalVariable(arg: 7, scope: !0, name: "foo",
3968 /// ::= !DILocalVariable(scope: !0, name: "foo",
3973 OPTIONAL(name, MDStringField, ); \
3983 (Context, scope.Val, name.Val, file.Val, line.Val,
3991 assert(Lex.getKind() == lltok::MetadataVar && "Expected metadata type name");
4027 /// ::= !DIObjCProperty(name: "foo", file: !1, line: 7, setter: "setFoo",
4031 OPTIONAL(name, MDStringField, ); \
4042 (Context, name.Val, file.Val, line.Val, setter.Val,
4049 /// line: 7, name: "foo")
4056 OPTIONAL(name, MDStringField, );
4061 entity.Val, line.Val, name.Val));
4166 if (!PFS) return Error(ID.Loc, "invalid use of function-local name");
4170 if (!PFS) return Error(ID.Loc, "invalid use of function-local name");
4387 return TokError("expected function name");
4532 // If the argument has a name, insert it into the argument symbol table.
4533 if (ArgList[i].Name.empty()) continue;
4535 // Set the name, if it conflicted, it will be auto-renamed.
4536 ArgIt->setName(ArgList[i].Name);
4538 if (ArgIt->getName() != ArgList[i].Name)
4540 ArgList[i].Name + "'");
4581 "Expected local id or name");
4638 // If this basic block starts out with a name, remember it.
4639 std::string Name;
4642 Name = Lex.getStrVal();
4646 BasicBlock *BB = PFS.DefineBB(Name, NameLoc);
4649 Name + "'");
4656 // This instruction may have three possibilities for a name: a) none
4657 // specified, b) name specified "%foo =", c) number specified: "%4 =".
4670 if (ParseToken(lltok::equal, "expected '=' after instruction name"))
4696 // Set the name on the instruction.
6243 return Error(Fn.Loc, "expected function name in uselistorder_bb");
6248 return Error(Fn.Loc, "expected function name in uselistorder_bb");
6256 return Error(Label.Loc, "expected basic block name in uselistorder_bb");