search for: registermdkind

Displaying 6 results from an estimated 6 matches for "registermdkind".

2009 Sep 11
0
[LLVMdev] [proposal] Extensible IR metadata
...access to it. It would be more convenient for users if instead of MDNode *DbgInfo = Inst->getMD(MDKind::DbgTag); Inst2->setMD(MDKind::DbgTag, DbgInfo); they could write: DILocation DbgInfo = Inst->getMD<DILocation>(); inst2->setMD(DbgInfo); we'd use TheContext->RegisterMDKind<MyKindWrapper>() or ...Register<MyKindWrapper>("name"); to register a new kind. (I prefer the first.) These kind wrappers need a couple methods to make them work: const StringRef KindWrapper::name("..."); KindWrapper(MDNode*); // Except for special cases like LdSt...
2009 Sep 11
4
[LLVMdev] [proposal] Extensible IR metadata
...users if instead of > > MDNode *DbgInfo = Inst->getMD(MDKind::DbgTag); > Inst2->setMD(MDKind::DbgTag, DbgInfo); > > they could write: > > DILocation DbgInfo = Inst->getMD<DILocation>(); > inst2->setMD(DbgInfo); > > we'd use TheContext->RegisterMDKind<MyKindWrapper>() or > ...Register<MyKindWrapper>("name"); to register a new kind. (I prefer > the first.) Yes, this is very convenient. This along with the rest of Chris' proposal is very similar to the way we handled metadata in a compiler I worked on years ago....
2009 Sep 11
12
[LLVMdev] [proposal] Extensible IR metadata
Devang's work on debug info prompted this, thoughts welcome: http://nondot.org/sabre/LLVMNotes/ExtensibleMetadata.txt -Chris
2009 Sep 12
0
[LLVMdev] [proposal] Extensible IR metadata
...p 11, 2009, at 3:23 PM, David Greene wrote: > I have a few questions and comments about Chris' initial proposal as > well. > > - I don't like the separation between "built-in" metadata and > "extended" > metadata. Why not make all metadata use the RegisterMDKind > interface and > just have the LLVM libraries do it automatically for the "built-in" > stuff? > Having a separate namespace of enums is going to get confusing. > Practically > every day I curse the fact that "int" is different than "MyInt"...
2009 Sep 16
1
[LLVMdev] [proposal] Extensible IR metadata
...). But I can also change it when I add the wrapper types. It's too bad we don't have a SmallMap class to give MDInfoTy a good API and make it efficient at both small and large map sizes. Maybe s/MDInfoTy/MDMapTy/ to point out that it's a map from MDKindIds to MDNodes? Comment whether RegisterMDKind requires that its argument is as-yet-unknown in Metadata.h. Context.pImpl->TheMetadata.ValueIsDeleted(this); in ~Value will always call the empty ValueIsDeleted(Value*) overload. Please write a unittest for this. Metadata::getMDKind(Name) can just be "return MDHandlerNames.lookup(Name)&q...
2009 Sep 16
0
[LLVMdev] [proposal] Extensible IR metadata
On Fri, Sep 11, 2009 at 9:57 AM, Chris Lattner <clattner at apple.com> wrote: > Devang's work on debug info prompted this, thoughts welcome: > http://nondot.org/sabre/LLVMNotes/ExtensibleMetadata.txt Here is partial initial implementation. Thoughts ? - Devang -------------- next part -------------- A non-text attachment was scrubbed... Name: mdn.diff Type: application/octet-stream