[lld] r190585 - Do not hard code the leading underscore.

Rui Ueyama ruiu at google.com
Thu Sep 12 12:23:32 PDT 2013


Hi Joey,

On Thu, Sep 12, 2013 at 3:09 AM, Joey Gouly <joey.gouly at arm.com> wrote:

> Hi Rui,
>
> > +  /// Returns the decorated name of the given symbol name. On 32-bit
> x86,
> it
> > +  /// adds "_" at the beginning of the string. On other architectures,
> the
> > +  /// return value is the same as the argument.
> > +  StringRef decorateSymbol(StringRef name) const {
> > +    // Because we don't support architectures other than 32-bit x86,
> we'll
> > +    // prepend an underscore unconditionally.
> > +    std::string str = "_";
> > +    str.append(name);
> > +    return allocateString(str);
> > +  }
> > +
>
> The doxygen comment and the implementation don't match here. I know you
> said
> we only support
> 32-bit x86 for now, but how hard would it be to implement it correctly now?
> Or change the doxygen comment to match the current implementation?
>

The problem is that we don't have a variable indicating which platform we
are linking to, so we can't say wether we are producing x86-32 binary or
not. We assume we are always creating x86-32 binary instead in many
places... That being said, it should be easy to add such variable and use
it here. Let me do that.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130912/8f668fbf/attachment.html>


More information about the llvm-commits mailing list