1 //===- Reproduce.h - Utilities for creating reproducers ---------*- C++ -*-===//
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLD_CORE_REPRODUCE_H
11 #define LLD_CORE_REPRODUCE_H
13 #include "lld/Core/LLVM.h"
14 #include "llvm/ADT/StringRef.h"
15 #include "llvm/Support/Error.h"
18 namespace opt { class Arg; }
23 // Makes a given pathname an absolute path first, and then remove
24 // beginning /. For example, "../foo.o" is converted to "home/john/foo.o",
25 // assuming that the current directory is "/home/john/bar".
26 std::string relativeToRoot(StringRef Path);
28 // Quote a given string if it contains a space character.
29 std::string quote(StringRef S);
31 // Rewrite the given path if a file exists with that pathname, otherwise
32 // returns the original path.
33 std::string rewritePath(StringRef S);
35 // Returns the string form of the given argument.
36 std::string toString(llvm::opt::Arg *Arg);