[all-commits] [llvm/llvm-project] 62eec1: [clang-rename] Exit gracefully when no input provided

Shivam Gupta via All-commits all-commits at lists.llvm.org
Wed Apr 26 07:54:59 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 62eec1584d2cd7634c31d4b82215fa8e260cf3b8
      https://github.com/llvm/llvm-project/commit/62eec1584d2cd7634c31d4b82215fa8e260cf3b8
  Author: Shivam Gupta <Shivam.Gupta2 at amd.com>
  Date:   2023-04-26 (Wed, 26 Apr 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    A clang/test/clang-rename/NonExistFile.cpp
    M clang/tools/clang-rename/ClangRename.cpp

  Log Message:
  -----------
  [clang-rename] Exit gracefully when no input provided

clang-rename on a non existing file segfaults

Command to run -
$ clang-rename -offset=0 -new-name=plop asdasd

Error while processing llvm-project/asdasd.
clang-rename: llvm-project/llvm/include/llvm/Support/ErrorOr.h:237:
llvm::ErrorOr<T>::storage_type* llvm::ErrorOr<T>::getStorage()
[with T = const clang::FileEntry*; llvm::ErrorOr<T>::storage_type = const clang::FileEntry*]:
Assertion `!HasError && "Cannot get value when an error exists!"' failed.

[1]    827497 IOT instruction  clang-rename -offset=0 -new-name=plop asdasd

This fixes https://github.com/llvm/llvm-project/issues/36471.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D148439




More information about the All-commits mailing list