[all-commits] [llvm/llvm-project] e7b40c: [llvm] [unittest] Allow getting a C string from th...

Sergej Jaskiewicz via All-commits all-commits at lists.llvm.org
Tue Sep 8 15:53:46 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e7b40c5492e5c4b182df421892136d2ee6868124
      https://github.com/llvm/llvm-project/commit/e7b40c5492e5c4b182df421892136d2ee6868124
  Author: Sergej Jaskiewicz <jaskiewiczs at icloud.com>
  Date:   2020-09-09 (Wed, 09 Sep 2020)

  Changed paths:
    M llvm/include/llvm/Testing/Support/SupportHelpers.h
    M llvm/unittests/Support/LockFileManagerTest.cpp

  Log Message:
  -----------
  [llvm] [unittest] Allow getting a C string from the TempDir helper class

The TempDir.path() member function returns a StringRef. We've been
calling the data() method on that StringRef, which does not guarantee
to return a null-terminated string (required by chdir and other POSIX
functions).

Introduce the c_str() method in the TempDir class, which returns the
proper string without the need to create a copy of the path at use site.




More information about the All-commits mailing list