[LLVMdev] Type inconsistency in LLVM 3.1: CGDebugInfo.cpp
Benjamin Kramer
benny.kra at gmail.com
Thu Aug 9 10:54:55 PDT 2012
On 09.08.2012, at 19:43, "Gaster, Benedict" <Benedict.Gaster at amd.com> wrote:
> I’m probably missing something simple here but in:
>
> CGDebugInfo.h:
>
> std::vector<std::pair<void *, llvm::WeakVH> >ReplaceMap;
>
> but then in
>
> CGDebugInfo.cpp:
>
> llvm::DIType TC = getTypeOrNull(Ty);
>
> void * v = Ty.getAsOpaquePtr();
> std::pair<void *, llvm::WeakVH> tmp = std::make_pair(v, TC);
>
> if (TC.Verify() && TC.isForwardDecl())
> ReplaceMap.push_back(Ty.getTypeOrNull(), TC);
>
> Note that TC is of type llvm:DIType and not WeakVH.
>
> What am I missing, as this does not compile under Visual Studio 2012 RC?
Tricky code, DIType (or rather its superclass DIDescriptor) implicitly converts to MDNode* via a operator overload. MDNode is a subclass of Value, and WeakVH is constructible from Value*.
Wouldn't surprise me if MSVC has problems eating that, lots of magic involved here.
- Ben
>
> Regards,
>
> Ben
>
> - Benedict R. Gaster
> Enjoy Berlin and submit a paper to Multiprog 2013: http://multiprog.ac.upc.edu/
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list