<div dir="ltr"><div><div><div><div><div><div><div>Hi,<br></div>I am writing a tool that has to generate forward declarations of the classes, functions and templates.<br></div>So, if it encounters,<br></div>class Foo {<br>};<br>

</div>The output should be:<br></div>class Foo;<br><br></div>I am just trying to consider a specific case first by overriding VisitCXXRecordDecl .<br><br></div><div>The print method of the declaration seems to print the whole definition.<br>

Declaration->print(llvm::outs(),clang::PrintingPolicy(clang::LangOptions()));<br><br><br></div><div>Is there a general way of doing this?<br></div><div>Or should I try to generate declaration in an adhoc way?<br></div>

<div>Something like...<br></div><div>llvm::outs()<< `GET TYPE` << `GET NAME` << `ATTRIBUTES` ; <br></div></div>