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

Method generateType

lib/inputanalysis/DefMapGenerator.cpp:201–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201std::shared_ptr<Type>
202DefMapGenerator::generateType(ASTDefNode &Node,
203 const TypeAnalysisReport &Report) const {
204 const auto *AN = Node.getNodeForType();
205 if (!AN)
206 return nullptr;
207
208 const auto &T = AN->getType();
209 assert((T.getTypePtrOrNull() != nullptr) && "Unexpected Program State");
210
211 auto &Ctx = AN->getASTUnit().getASTContext();
212 if (T->isVoidPointerType()) {
213 if (const auto *E = AN->getNode().get<Expr>()) {
214 E = E->IgnoreCasts();
215 if (isa<StringLiteral>(E))
216 return Type::createCharPointerType();
217 }
218 }
219
220 auto Result = Type::createType(T, Ctx, nullptr, &Report);
221 if (!Result)
222 return nullptr;
223 return Result;
224}
225
226ASTValue
227DefMapGenerator::generateValue(ASTDefNode &Node,

Callers

nothing calls this directly

Calls 2

getNodeForTypeMethod · 0.80
getTypeMethod · 0.45

Tested by

no test coverage detected