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

Method ASTData

tests/testutil/CompileHelper.cpp:190–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188 : Name("temp"), Path(Path), Opt(Opt), Type(Type), Generated(false) {}
189
190CompileHelper::ASTData::ASTData(const SourceFileData &SourceFile)
191 : Path(SourceFile.Path + ".ast") {
192
193 auto Compiler = CompileHelper::getCompiler(SourceFile.Type);
194 if (Compiler.empty())
195 return;
196
197 auto CMD = Compiler + " " + SourceFile.Opt + " -emit-ast -o " + Path +
198 " -c " + SourceFile.Path;
199 if (system(CMD.c_str()) || !fs::exists(Path))
200 return;
201
202 Ptr = clang::ASTUnit::LoadFromASTFile(
203 Path, clang::RawPCHContainerReader(), clang::ASTUnit::LoadASTOnly,
204 clang::CompilerInstance::createDiagnostics(
205 new clang::DiagnosticOptions()),
206 clang::FileSystemOptions());
207 if (!Ptr && fs::exists(Path))
208 fs::remove(Path);
209}
210
211CompileHelper::ASTData::ASTData(ASTData &&Data) {
212

Callers

nothing calls this directly

Calls 1

emptyMethod · 0.80

Tested by

no test coverage detected