[llvm] r228200 - IR: Define MDNode uniquing sets automatically, NFC

David Blaikie dblaikie at gmail.com
Wed Feb 4 14:07:49 PST 2015


On Wed, Feb 4, 2015 at 2:06 PM, Duncan P. N. Exon Smith <
dexonsmith at apple.com> wrote:

>
> > On 2015-Feb-04, at 14:02, David Blaikie <dblaikie at gmail.com> wrote:
> >
> >
> >
> > On Wed, Feb 4, 2015 at 1:46 PM, Duncan P. N. Exon Smith <
> dexonsmith at apple.com> wrote:
> > Author: dexonsmith
> > Date: Wed Feb  4 15:46:12 2015
> > New Revision: 228200
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=228200&view=rev
> > Log:
> > IR: Define MDNode uniquing sets automatically, NFC
> >
> > Modified:
> >     llvm/trunk/lib/IR/LLVMContextImpl.h
> >
> > Modified: llvm/trunk/lib/IR/LLVMContextImpl.h
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/LLVMContextImpl.h?rev=228200&r1=228199&r2=228200&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/IR/LLVMContextImpl.h (original)
> > +++ llvm/trunk/lib/IR/LLVMContextImpl.h Wed Feb  4 15:46:12 2015
> > @@ -357,9 +357,8 @@ public:
> >    DenseMap<Value *, ValueAsMetadata *> ValuesAsMetadata;
> >    DenseMap<Metadata *, MetadataAsValue *> MetadataAsValues;
> >
> > -  DenseSet<MDTuple *, MDTupleInfo> MDTuples;
> > -  DenseSet<MDLocation *, MDLocationInfo> MDLocations;
> > -  DenseSet<GenericDebugNode *, GenericDebugNodeInfo> GenericDebugNodes;
> > +#define HANDLE_MDNODE_LEAF(CLASS) DenseSet<CLASS *, CLASS##Info>
> CLASS##s;
> >
> > I /think/ (but could well be wrong) that the usual style for def file
> inclusions is to undef the relevant macro immediately after the inclusion,
> so it doesn't leak into other things, etc.
> >
> > +#include "llvm/IR/Metadata.def"
>
> Metadata.def ends with:
>
> #undef HANDLE_METADATA
> #undef HANDLE_METADATA_LEAF
> #undef HANDLE_METADATA_BRANCH
> #undef HANDLE_MDNODE_LEAF
> #undef HANDLE_MDNODE_BRANCH
>

Ah, dandy. (maybe that's the common idiom - if not, might be nice to update
existing .def files to be so smart - I'll keep it in mind next time I come
across a #include .def)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150204/d9d10f71/attachment.html>


More information about the llvm-commits mailing list