libtooling Questions

2

Solved

I'm trying to write a source to source translator using libTooling. I'm using ASTMatchers to try to find if statements that don't have curly braces and then use a rewriter to add the braces. The ...
Mcmillon asked 19/5, 2016 at 10:27

2

Consider the following struct definition in foo.cc: struct Foo { int &bar; }; Because bar has reference type, the implicit trivial default constructor Foo::Foo() is implicitly deleted. Howeve...
Kelsey asked 12/3, 2021 at 12:4

3

tldr;> How do I hide warnings from system headers in clang-tidy? I have the following minimal example source file, which triggers a clang-tidy warning in the system headers: #include <future&g...
Disapproval asked 9/10, 2017 at 3:7

4

Solved

How to get parameter information as a string from FunctionDecl class in clang . I'm trying but getting confused by so many inheritances. Also they compiler is saying that getReturnType() is not a m...
Scarlett asked 23/6, 2014 at 10:29

1

I am using Clang/libtooling (ASTComsumer with a Matcher) to visit ALL return statements (ReturnStmt). I need to extract the expression that comes after the keyword return in a string form so that I...
Leibniz asked 20/7, 2018 at 16:27

2

Solved

I'm writing a libtooling refactoring tool. I have a class, let's say Foo, defined in a header called foo.h. I want to see if foo.h is included in a file. Currently, to check if bar.cc includes foo....
Langur asked 19/11, 2014 at 23:53

2

Solved

I'm using LibTooling to do some analysis. I know how to traverse the AST and insert some text into somewhere. For example, Rewriter mywriter; mywriter.InsertTextAfter(func->getLocEnd(),"Hello")...
Lochner asked 1/4, 2017 at 12:57

0

Consider the following code int function() { unknownType variable; } In the above code snippet, "unknownType" is not resolved at compile time, so clang will put default type as int in the AST a...
Twinkle asked 31/12, 2016 at 10:16

1

Solved

i implemented a custom attribute in clang as described in the official manual: http://clang.llvm.org/docs/InternalsManual.html#how-to-add-an-attribute So i added the following Code to Attr.td: ...
Convenience asked 15/7, 2016 at 8:23

4

Solved

I want to use Clang and LibTooling to create some C++ source analysis and transformation tools. I've built Clang and LibTooling following this tutorial, and I've been able to run and create some an...
Yves asked 23/11, 2014 at 18:23

1

Solved

I am trying to create an OCLint rule that matches both typedef enum and typedef NS_ENUM declarations, with little success. I have an Objective-C file (TestClass.m) with the following enum declarati...
Acrilan asked 20/4, 2015 at 17:29

2

Examples found on the web for clang tools are always run on toy examples, which are usually all really trivial C programs. I am building a tool which performs source-to-source transformations on ...
Ladon asked 22/9, 2014 at 1:27
1

© 2022 - 2024 — McMap. All rights reserved.