[PATCH] D61343: [llvm-objcopy] Cache gnu_debuglink's target CRC
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 2 02:01:02 PDT 2019
MaskRay added inline comments.
================
Comment at: llvm/tools/llvm-objcopy/CopyConfig.cpp:502
+ if (!DebugOrErr)
+ return createStringError(errc::no_such_file_or_directory, "'%s': %s",
+ Config.AddGnuDebugLink.str().c_str(),
----------------
MaskRay wrote:
> jhenderson wrote:
> > janisozaur wrote:
> > > jhenderson wrote:
> > > > Is "no_such_file_or_directory" the only way MemoryBuffer::getFile can file? What about things like "it's a directory" or "access denied"? If it isn't the only way, we shouldn't be using this misleading error code.
> > > This one seemed the most relevant. Originally `exit(1)` was used explicitly.
> > >
> > > All the other option parsing code returns invalid argument (I think it's 22), but it also doesn't verify existence and readability of files.
> > Okay. How about we just use the error code stored in DebugOrErr?
> `return errorCodeToError(DebugOrErr.getError());`
`return createFileError(Config.AddGnuDebugLink, DebugOrErr.getError());`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61343/new/
https://reviews.llvm.org/D61343
More information about the llvm-commits
mailing list