Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
こんにちは、clang libtooling を使用しています。.c ファイルを取得して、存在するすべての関数の名前と関数宣言が含まれる行を出力する必要があります。 Stmts。
を指定するとFunctionDecl *f、f->getSourceRange()そのソース範囲 (最初と最後) になります。を指定するとSourceRange sr、範囲の始まりである がsr.getBegin()得られます。SourceLocation
FunctionDecl *f
f->getSourceRange()
SourceRange sr
sr.getBegin()
SourceLocation
詳細については、言及されているクラスのドキュメント/宣言を参照してください。