[llvm] r247744 - [llvm-cxxdump] Remove duplicate code check.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 05:23:32 PDT 2015


Thanks!

Nice to see these "Time of check to time of use" bugs going away.

On 15 September 2015 at 19:35, Davide Italiano via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: davide
> Date: Tue Sep 15 18:35:32 2015
> New Revision: 247744
>
> URL: http://llvm.org/viewvc/llvm-project?rev=247744&view=rev
> Log:
> [llvm-cxxdump] Remove duplicate code check.
>
> We already fail with 'No such file or directory' when we try to open
> the file -- if that doesn't exist. Also add a test to verify this behavior.
>
> Modified:
>     llvm/trunk/test/tools/llvm-cxxdump/trivial.test
>     llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp
>
> Modified: llvm/trunk/test/tools/llvm-cxxdump/trivial.test
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cxxdump/trivial.test?rev=247744&r1=247743&r2=247744&view=diff
> ==============================================================================
> --- llvm/trunk/test/tools/llvm-cxxdump/trivial.test (original)
> +++ llvm/trunk/test/tools/llvm-cxxdump/trivial.test Tue Sep 15 18:35:32 2015
> @@ -56,3 +56,6 @@ ELF-I386:      _ZTS1A: 1A
>  ELF-I386-NEXT: _ZTV1A[0]: 0
>  ELF-I386-NEXT: _ZTV1A[4]: _ZTI1A
>  ELF-I386-NEXT: _ZTV1A[8]: _ZN1A1fEv
> +
> +RUN: not llvm-cxxdump %t.blah 2>&1 | FileCheck --check-prefix=ENOENT %s
> +ENOENT: {{.*}}.blah: {{[Nn]}}o such file or directory
>
> Modified: llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp?rev=247744&r1=247743&r2=247744&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp (original)
> +++ llvm/trunk/tools/llvm-cxxdump/llvm-cxxdump.cpp Tue Sep 15 18:35:32 2015
> @@ -499,12 +499,6 @@ static void dumpArchive(const Archive *A
>  }
>
>  static void dumpInput(StringRef File) {
> -  // If file isn't stdin, check that it exists.
> -  if (File != "-" && !sys::fs::exists(File)) {
> -    reportError(File, cxxdump_error::file_not_found);
> -    return;
> -  }
> -
>    // Attempt to open the binary.
>    ErrorOr<OwningBinary<Binary>> BinaryOrErr = createBinary(File);
>    if (std::error_code EC = BinaryOrErr.getError()) {
>
>
> _______________________________________________
> 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