<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:rafael.espindola@gmail.com" title="Rafael Ávila de Espíndola <rafael.espindola@gmail.com>"> <span class="fn">Rafael Ávila de Espíndola</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Fix the design of GlobalAlias to not require dest type to match source type"
   href="http://llvm.org/bugs/show_bug.cgi?id=10367">bug 10367</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>FIXED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Fix the design of GlobalAlias to not require dest type to match source type"
   href="http://llvm.org/bugs/show_bug.cgi?id=10367#c16">Comment # 16</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Fix the design of GlobalAlias to not require dest type to match source type"
   href="http://llvm.org/bugs/show_bug.cgi?id=10367">bug 10367</a>
              from <span class="vcard"><a class="email" href="mailto:rafael.espindola@gmail.com" title="Rafael Ávila de Espíndola <rafael.espindola@gmail.com>"> <span class="fn">Rafael Ávila de Espíndola</span></a>
</span></b>
        <pre>This was fixed, but not in the way that is discussed in this bug. Instead,
alias are defined to point to arbitrary expressions and we changed all the code
that thought it was possible to, for example, find the aliased symbol.

The argument that convinced me to go this ways is that at the assembly level
expressions like

a = b - c

are sometime valid depending on what b and c are. Before r210062 there was no
way to produce such an expression in LLVM. What we now have is

* GlobalObjecs introduce new data. They are functions or variables. They
normally have a symbol (except for some cases with private linkage).
* GlobalAliases define a label pointing somewhere. At the LLVM level it is not
possible to know if the expression defining the location is valid or not.

I would love to be able to tell if a given expression is valid at the IR level
without dropping support for representing any expression an assembler supports,
but that would be quite a massive change:

With pr10368 we would basically get expressions to represent what is
representable with relocations in object files. In addition to that we would
need to be have a different expression type for all the cases that don't need a
relocation. This would require knowing at the llvm level what section/atom a
label is in.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>