[PATCH] D26161: '.' is not absolute

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 31 13:56:02 PDT 2016


On 31 October 2016 at 16:30, Rui Ueyama <ruiu at google.com> wrote:
> ruiu added inline comments.
>
>
> ================
> Comment at: ELF/LinkerScript.cpp:1190
>      StringRef Tok = next();
> -    BaseCommand *Cmd = readProvideOrAssignment(Tok, true);
> +    BaseCommand *Cmd = readProvideOrAssignment(Tok, false);
>      if (!Cmd) {
> ----------------
> instead, replace `false` with `[]() { return false; }`.

readProvideOrAssignment takes a boolean. I intend to completely remove
the argument in a followup commit.

>
> ================
> Comment at: ELF/LinkerScript.h:46
>
>    template <typename T>
>    Expr(T Val, std::function<bool()> IsAbsolute)
> ----------------
> Instead of T, can we use just uint64_t?

We can use std::function. I will upload a new patch.

>
> ================
> Comment at: ELF/LinkerScript.h:49
>        : Val(Val), IsAbsolute(IsAbsolute) {}
>    template <typename T> Expr(T Val, bool IsAbsolute) : Val(Val) {
>      this->IsAbsolute = [=]() { return IsAbsolute; };
> ----------------
> This function is too thin as a wrapper for Expr(T, std::function<bool()>), so I wouldn't add this.

Good point.

Uploading a new patch.


More information about the llvm-commits mailing list