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

Method check

lib/inputfilter/RawStringFilter.cpp:14–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12 : InputFilter(RawStringFilter::FilterName, std::move(NextFilter)) {}
13
14bool RawStringFilter::check(const ASTIRNode &Node) const {
15 const auto *Assigned = Node.AST.getAssigned();
16 if (!Assigned)
17 return false;
18
19 const auto *S = Assigned->getNode().get<Stmt>();
20 if (!S)
21 return false;
22
23 const auto &SrcManager =
24 const_cast<ASTNode *>(Assigned)->getASTUnit().getSourceManager();
25 auto LangOptions = clang::LangOptions();
26 auto Loc = SrcManager.getTopMacroCallerLoc(util::getDebugLoc(*S));
27
28 Token T;
29 if (Lexer::getRawToken(Loc, T, SrcManager, LangOptions))
30 return false;
31 if (!T.is(tok::raw_identifier))
32 return false;
33
34 auto NT = Lexer::findNextToken(Loc, SrcManager, LangOptions);
35 if (!NT)
36 return false;
37
38 auto Spelling = Lexer::getSpelling(*NT, SrcManager, LangOptions);
39 return Spelling.find("\"") == 0;
40}
41
42} // namespace ftg

Callers

nothing calls this directly

Calls 3

getDebugLocFunction · 0.85
getAssignedMethod · 0.80
findMethod · 0.45

Tested by

no test coverage detected