1//===- Reproduce.h - Utilities for creating reproducers ---------*- C++ -*-===//
2//
3//                             The LLVM Linker
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLD_COMMON_REPRODUCE_H
11#define LLD_COMMON_REPRODUCE_H
12
13#include "lld/Common/LLVM.h"
14#include "llvm/ADT/StringRef.h"
15#include "llvm/Support/Error.h"
16
17namespace llvm {
18namespace opt { class Arg; }
19}
20
21namespace lld {
22
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".
26std::string relativeToRoot(StringRef Path);
27
28// Quote a given string if it contains a space character.
29std::string quote(StringRef S);
30
31// Rewrite the given path if a file exists with that pathname, otherwise
32// returns the original path.
33std::string rewritePath(StringRef S);
34
35// Returns the string form of the given argument.
36std::string toString(llvm::opt::Arg *Arg);
37}
38
39#endif
40