[PATCH] D14275: Make createReferenceType take size and align

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 2 21:41:10 PST 2015


Gut reaction: This would cause extra DWARF to be emitted which might be
erroneous/confusing... (though, as you point out, there's not much of an
argument for being inconsistent with pointers here)

What's the DWARF look like for pointers and references before and after
your patch? (& the usual "what does GCC do?")

On Mon, Nov 2, 2015 at 7:18 PM, Keno Fischer via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> loladiro created this revision.
> loladiro added reviewers: aprantl, dexonsmith.
> loladiro added a subscriber: llvm-commits.
> loladiro set the repository for this revision to rL LLVM.
>
> Since we're passing references to dbg.value as pointers, we need to have
> the frontend properly declare their sizes and alignments (as it already
> does for regular pointers) in preparation for my upcoming patch to have the
> verifer check that the sizes agree.
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D14275
>
> Files:
>   include/llvm/IR/DIBuilder.h
>   lib/IR/DIBuilder.cpp
>
> Index: lib/IR/DIBuilder.cpp
> ===================================================================
> --- lib/IR/DIBuilder.cpp
> +++ lib/IR/DIBuilder.cpp
> @@ -255,10 +255,12 @@
>                              DITypeRef::get(Base));
>  }
>
> -DIDerivedType *DIBuilder::createReferenceType(unsigned Tag, DIType *RTy) {
> +DIDerivedType *DIBuilder::createReferenceType(unsigned Tag, DIType *RTy,
> +                                              uint64_t SizeInBits,
> +                                              uint64_t AlignInBits) {
>    assert(RTy && "Unable to create reference type");
>    return DIDerivedType::get(VMContext, Tag, "", nullptr, 0, nullptr,
> -                            DITypeRef::get(RTy), 0, 0, 0, 0);
> +                            DITypeRef::get(RTy), SizeInBits, AlignInBits,
> 0, 0);
>  }
>
>  DIDerivedType *DIBuilder::createTypedef(DIType *Ty, StringRef Name,
> Index: include/llvm/IR/DIBuilder.h
> ===================================================================
> --- include/llvm/IR/DIBuilder.h
> +++ include/llvm/IR/DIBuilder.h
> @@ -158,7 +158,9 @@
>
>      /// Create debugging information entry for a c++
>      /// style reference or rvalue reference type.
> -    DIDerivedType *createReferenceType(unsigned Tag, DIType *RTy);
> +    DIDerivedType *createReferenceType(unsigned Tag, DIType *RTy,
> +                                       uint64_t SizeInBits = 0,
> +                                       uint64_t AlignInBits = 0);
>
>      /// Create debugging information entry for a typedef.
>      /// \param Ty          Original type.
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151102/25be6d33/attachment.html>


More information about the llvm-commits mailing list