[PATCH] D18261: Show members of DeclContexts (i.e., class members) in Visual Studio native visualizers

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 18 08:56:55 PDT 2016


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM!


================
Comment at: clang.natvis:77
@@ +76,3 @@
+  
+  <!-- Unfortunately, Visual Studio has trouble seeing the PointerBitMask member PointerIntUnion, so I hardwire it to 2 bits-->
+  <Type Name="clang::DeclContext">
----------------
mspertus wrote:
> aaron.ballman wrote:
> > The only hard-wiring I see uses 3 bits, so is this comment still accurate?
> I think the code is correct. 
> ```
>   llvm::PointerIntPair<Decl *, 2, unsigned> NextInContextAndBits;
> 
> ```
> so `NextInContextAndBits` uses 2 bits for the `int` part. Just to be sure, I also double checked in the debugger (an `IntMask` of 3 represents two bits :) ),
> 
> ```
> 		((((clang::DeclContext *)(clang::CXXRecordDecl *)D)->FirstDecl)->NextInContextAndBits).IntMask	IntMask (3)	llvm::PointerIntPair<clang::Decl *,2,unsigned int,llvm::PointerLikeTypeTraits<clang::Decl *> >::<unnamed-enum-PointerBitMask>
> 
> ```
Oh yeah, that's right, an IntMask of 3 does represent 2 bits. Sorry for the confusion!


http://reviews.llvm.org/D18261





More information about the cfe-commits mailing list