[lld] r308519 - Handle option aliases in a better way.
Rafael Avila de Espindola via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 19 14:18:43 PDT 2017
Thanks!
Rui Ueyama via llvm-commits <llvm-commits at lists.llvm.org> writes:
> Author: ruiu
> Date: Wed Jul 19 13:30:04 2017
> New Revision: 308519
>
> URL: http://llvm.org/viewvc/llvm-project?rev=308519&view=rev
> Log:
> Handle option aliases in a better way.
>
> In this way, we don't need to know which options have aliases.
>
> Modified:
> lld/trunk/COFF/Driver.cpp
> lld/trunk/ELF/Driver.cpp
>
> Modified: lld/trunk/COFF/Driver.cpp
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=308519&r1=308518&r2=308519&view=diff
> ==============================================================================
> --- lld/trunk/COFF/Driver.cpp (original)
> +++ lld/trunk/COFF/Driver.cpp Wed Jul 19 13:30:04 2017
> @@ -201,7 +201,7 @@ void LinkerDriver::parseDirectives(Strin
> opt::InputArgList Args = Parser.parse(S);
>
> for (auto *Arg : Args) {
> - switch (Arg->getOption().getID()) {
> + switch (Arg->getOption().getUnaliasedOption().getID()) {
> case OPT_alternatename:
> parseAlternateName(Arg->getValue());
> break;
>
> Modified: lld/trunk/ELF/Driver.cpp
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=308519&r1=308518&r2=308519&view=diff
> ==============================================================================
> --- lld/trunk/ELF/Driver.cpp (original)
> +++ lld/trunk/ELF/Driver.cpp Wed Jul 19 13:30:04 2017
> @@ -804,14 +804,13 @@ static bool getBinaryOption(StringRef S)
>
> void LinkerDriver::createFiles(opt::InputArgList &Args) {
> for (auto *Arg : Args) {
> - switch (Arg->getOption().getID()) {
> + switch (Arg->getOption().getUnaliasedOption().getID()) {
> case OPT_l:
> addLibrary(Arg->getValue());
> break;
> case OPT_INPUT:
> addFile(Arg->getValue(), /*WithLOption=*/false);
> break;
> - case OPT_alias_script_T:
> case OPT_script:
> if (Optional<MemoryBufferRef> MB = readFile(Arg->getValue()))
> readLinkerScript(*MB);
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list