On Thu, Oct 18, 2012 at 12:55 AM, Nick Lewycky <[email protected]> wrote:

> Author: nicholas
> Date: Thu Oct 18 02:55:46 2012
> New Revision: 166171
>
> URL: http://llvm.org/viewvc/llvm-project?rev=166171&view=rev
> Log:
> Put used="1" on all used declarations in the XML dumper. This allows us to
> start seeing the bit so that we can find bugs and write tests for it.
>

Note, likely the best way to test this bit is to use the AST unit testing
facilities we now have, similar to the discussion of the SourceLocation
unit tests.

I still think dumping this bit is crazy useful of course... =]


>
> Modified:
>     cfe/trunk/lib/AST/DumpXML.cpp
>
> Modified: cfe/trunk/lib/AST/DumpXML.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DumpXML.cpp?rev=166171&r1=166170&r2=166171&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/AST/DumpXML.cpp (original)
> +++ cfe/trunk/lib/AST/DumpXML.cpp Thu Oct 18 02:55:46 2012
> @@ -1,4 +1,4 @@
> -//===--- DumpXML.cpp - Detailed XML dumping ---------------------*- C++
> -*-===//
> +//===--- DumpXML.cpp - Detailed XML dumping
> -------------------------------===//
>  //
>  //                     The LLVM Compiler Infrastructure
>  //
> @@ -64,6 +64,8 @@
>    static_cast<Impl*>(this)->NAME(static_cast<CLASS*>(D))
>
>    void dispatch(Decl *D) {
> +    if (D->isUsed())
> +      static_cast<Impl*>(this)->set("used", "1");
>      switch (D->getKind()) {
>  #define DECL(DERIVED, BASE) \
>        case Decl::DERIVED: \
>
>
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to