[cfe-dev] Question about Decl::isUsed()
Mikhail Ramalho via cfe-dev
cfe-dev at lists.llvm.org
Tue Jul 3 10:13:55 PDT 2018
I'm trying to write a tool to remove unused declarations from preprocessed
files but found an odd behaviour when using the Decl::isUsed() call.
It works great with clang::FunctionDecl and clang::ValueDecl, but when I
try to check the flag for clang::TagDecl or clang::TypedefNameDecl, it's
always false, even if it's used in the preprocessed file.
Is that the expected behaviour? I know that there might be problems when
dealing with cross TUs but I have a single preprocessed file and everything
is marked as unused.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev