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

Method getFirstVarDeclhasSameBeginLoc

lib/inputanalysis/DefMapGenerator.cpp:297–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297const Decl *
298DefMapGenerator::getFirstVarDeclhasSameBeginLoc(const VarDecl &D) const {
299 const auto *DC = D.getDeclContext();
300 if (!DC)
301 return &D;
302
303 DeclStmtFinder Finder(D);
304 Finder.TraverseDecl(Decl::castFromDeclContext(DC));
305 if (Finder.Result)
306 return *Finder.Result->decl_begin();
307
308 for (const auto *GDecl : DC->decls()) {
309 if (isa<VarDecl>(GDecl) && GDecl->getBeginLoc() == D.getBeginLoc())
310 return GDecl;
311 }
312 return &D;
313}
314
315std::pair<unsigned, std::string>
316DefMapGenerator::getDeclTypeInfo(const VarDecl &D,

Callers

nothing calls this directly

Calls 1

getBeginLocMethod · 0.80

Tested by

no test coverage detected