[pkg-d-commits] [ldc] 51/74: Fix compilation with LLVM trunk (#2139)

Matthias Klumpp mak at moszumanska.debian.org
Thu Jul 13 20:54:18 UTC 2017


This is an automated email from the git hooks/post-receive script.

mak pushed a commit to annotated tag v1.3.0-beta2
in repository ldc.

commit 95355479db9780ab0b3ace5af445772f093fd7e2
Author: Nicholas Wilson <thewilsonator at users.noreply.github.com>
Date:   Fri May 26 16:09:02 2017 +0800

    Fix compilation with LLVM trunk (#2139)
    
    In preparation for the testing for dcompute I was building against very recent trunk and hit the following.
    ```
    /Users/nicholaswilson/d/ldc/gen/attributes.cpp:94:31: error: no member named 'getNumSlots' in 'llvm::AttributeList'
      for (unsigned i = 0; i < os.getNumSlots(); ++i) {
                               ~~ ^
    /Users/nicholaswilson/d/ldc/gen/attributes.cpp:95:25: error: no member named 'getSlotIndex' in 'llvm::AttributeList'
        unsigned index = os.getSlotIndex(i);
                         ~~ ^
    /Users/nicholaswilson/d/ldc/gen/attributes.cpp:96:55: error: no member named 'getSlotAttributes' in 'llvm::AttributeList'; did you mean
          'getAttributes'?
        set = set.addAttributes(gIR->context(), index, os.getSlotAttributes(i));
                                                          ^~~~~~~~~~~~~~~~~
                                                          getAttributes
    /Users/nicholaswilson/d/llvm/include/llvm/IR/Attributes.h:455:16: note: 'getAttributes' declared here
      AttributeSet getAttributes(unsigned Index) const;
    ```
    The patch silences this error although I'm not sure that it fixes it. I feel like it should work though.
---
 gen/attributes.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gen/attributes.cpp b/gen/attributes.cpp
index 0bdd4c7..e69e129 100644
--- a/gen/attributes.cpp
+++ b/gen/attributes.cpp
@@ -91,9 +91,13 @@ AttrSet &AttrSet::add(unsigned index, const AttrBuilder &builder) {
 
 AttrSet &AttrSet::merge(const AttrSet &other) {
   auto &os = other.set;
+#if LDC_LLVM_VER >= 500
+  set = LLAttributeSet::get(gIR->context(), {set,os});
+#else
   for (unsigned i = 0; i < os.getNumSlots(); ++i) {
     unsigned index = os.getSlotIndex(i);
     set = set.addAttributes(gIR->context(), index, os.getSlotAttributes(i));
   }
+#endif
   return *this;
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-d/ldc.git



More information about the pkg-d-commits mailing list