llvm.org GIT mirror llvm / 1fcbca0
It could come about that we parse the inline ASM before we get a potential definition for it. In that case, we want to wait for the potential definition before we create a symbol for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153859 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 7 years ago
2 changed file(s) with 27 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
398398
399399 NameAndAttributes &info = _undefines[entry.getKey().data()];
400400
401 if (info.symbol == 0) {
402 // If we haven't seen this symbol before, save it and we may see it again.
403 StringMap::value_type
404 &asm_entry = _asm_defines.GetOrCreateValue(name);
405 NameAndAttributes &asm_info = _asm_defines[asm_entry.getKey().data()];
406 asm_info.name = name;
407 asm_info.attributes = scope;
408 asm_info.isFunction = false;
409 asm_info.symbol = 0;
410 return;
411 }
412
401413 if (info.isFunction)
402414 addDefinedFunctionSymbol(cast(info.symbol));
403415 else
450462 // we already have the symbol
451463 if (entry.getValue().name)
452464 return;
465
466 StringMap::value_type &asm_entry =
467 _asm_defines.GetOrCreateValue(name);
468
469 if (asm_entry.getValue().name != 0) {
470 if (isFunc)
471 addDefinedFunctionSymbol(cast(decl));
472 else
473 addDefinedDataSymbol(decl);
474
475 _symbols.back().attributes &= ~LTO_SYMBOL_SCOPE_MASK;
476 _symbols.back().attributes |= asm_entry.getValue().attributes;
477 return;
478 }
453479
454480 NameAndAttributes info;
455481
5252 // _defines and _undefines only needed to disambiguate tentative definitions
5353 StringSet _defines;
5454 llvm::StringMap _undefines;
55 llvm::StringMap _asm_defines;
5556 std::vector _asm_undefines;
5657 llvm::MCContext _context;
5758