<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 30, 2016 at 2:25 PM Victor <<a href="mailto:vleschuk@gmail.com">vleschuk@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">vleschuk added inline comments.<br>
<br>
================<br>
Comment at: include/llvm/IR/DebugInfoMetadata.h:183<br>
@@ -180,2 +182,3 @@<br>
   };<br>
+  typedef std::underlying_type<DIFlags>::type DIFlagsUnderlying;<br>
<br>
----------------<br>
dblaikie wrote:<br>
> I'm assuming we don't need DIFlagsUnderlying anymore? Can we just use DIFlags everywhere?<br>
Nope. For example see updated ::get definitions in classes derived from DINode:<br>
<br>
<br>
```<br>
DEFINE_MDNODE_GET(DIDerivedType,<br>
                    (unsigned Tag, MDString *Name, Metadata *File,<br>
                     unsigned Line, Metadata *Scope, Metadata *BaseType,<br>
                     uint64_t SizeInBits, uint64_t AlignInBits,<br>
                     uint64_t OffsetInBits, **DIFlagsUnderlying** Flags,<br>
                     Metadata *ExtraData = nullptr),<br>
                    (Tag, Name, File, Line, Scope, BaseType, SizeInBits,<br>
                     AlignInBits, OffsetInBits, **static_cast<DIFlags>(Flags)**, ExtraData))<br>
```<br>
<br>
This helps to avoid lots of static_casts in client code. Also some utility functions like splitFlags require this underlying type to process bitmasks which can consist not only of enumerated flags.<br>
<br>
In other words, this typedef is used in order not to break old code and avoid lots of code rewriting.<br></blockquote><div><br>It'd be nice to do the cleanup - some of it could be done ahead of this change, I assume (to keep it separate). Rather than having all this supported for the previous use case.<br><br>- Dave<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<a href="https://reviews.llvm.org/D23766" rel="noreferrer" target="_blank">https://reviews.llvm.org/D23766</a><br>
<br>
<br>
<br>
</blockquote></div></div>