Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TypeLoc buildTypeLoc(ASTContext *const c, const QualType qt)
- {
- TypeLocBuilder tlb;
- return tlb.getTypeLocInContext(*c, qt);
- }
- SourceRange getQualTypeSourceRange(ASTContext *const c, const QualType qt)
- {
- return buildTypeLoc(c, qt).getSourceRange();
- }
- for(clang::ASTUnit::top_level_iterator dit = au -> top_level_begin(); dit != au -> top_level_end(); dit++) {
- if (isa<VarDecl>(*dit)) {
- const VarDecl *vd = static_cast<const VarDecl *>(*dit);
- SourceRange sr = getQualTypeSourceRange(&au -> getASTContext(), vd -> getType());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment