MCPcopy Create free account
hub / github.com/Samsung/UTopia / generateDefinitions

Method generateDefinitions

lib/inputanalysis/DefMapGenerator.cpp:536–568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

534}
535
536std::vector<std::shared_ptr<Definition>>
537DefMapGenerator::generateDefinitions(std::vector<ASTIRNode> &Nodes,
538 const UTLoader &Loader,
539 const std::string &BaseDir) const {
540 std::unique_ptr<InputFilter> Filter = std::make_unique<NullPointerFilter>(
541 std::make_unique<RawStringFilter>(std::make_unique<ExternalFilter>(
542 Loader.getDirectionReport(),
543 std::make_unique<TypeUnavailableFilter>(
544 std::make_unique<CompileConstantFilter>(
545 std::make_unique<ConstIntArrayLenFilter>(
546 std::make_unique<InaccessibleGlobalFilter>(
547 std::make_unique<InvalidLocationFilter>(
548 BaseDir,
549 std::make_unique<UnsupportTypeFilter>()))))))));
550 assert(Filter && "Unexpected Program State");
551
552 std::map<DefLocKey, Definition> DefLocMap;
553 for (auto &Node : Nodes) {
554 auto Def = generateDefinition(Node, Loader);
555 Filter->start(Node, Def.Filters);
556 DefLocMap.emplace(DefLocKey({Def.Path, Def.Offset}), Def);
557 }
558
559 std::vector<std::shared_ptr<Definition>> Result;
560 unsigned IDCounter = 0;
561 for (auto &Iter : DefLocMap) {
562 auto &Def = Iter.second;
563 Def.ID = IDCounter++;
564 Result.push_back(std::make_shared<Definition>(Def));
565 }
566
567 return Result;
568}
569
570std::map<DefMapGenerator::DefLocKey, std::shared_ptr<Definition>>
571DefMapGenerator::generateKeyDefMap(

Callers

nothing calls this directly

Calls 2

DefLocKeyClass · 0.85
startMethod · 0.45

Tested by

no test coverage detected