File tree Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 18
18
19
19
namespace llvm {
20
20
21
+ class CleanupInstaller {
22
+ public:
23
+ // / The name of the file.
24
+ std::string Filename;
25
+
26
+ // / The flag which indicates whether we should not delete the file.
27
+ bool Keep;
28
+
29
+ StringRef getFilename () { return Filename; }
30
+ explicit CleanupInstaller (StringRef Filename);
31
+ ~CleanupInstaller ();
32
+ };
33
+
21
34
// / This class contains a raw_fd_ostream and adds a few extra features commonly
22
35
// / needed for compiler-like tool output files:
23
36
// / - The file is automatically deleted if the process is killed.
@@ -28,18 +41,7 @@ class ToolOutputFile {
28
41
// / before the raw_fd_ostream is constructed and destructed after the
29
42
// / raw_fd_ostream is destructed. It installs cleanups in its constructor and
30
43
// / uninstalls them in its destructor.
31
- class CleanupInstaller {
32
- public:
33
- // / The name of the file.
34
- std::string Filename;
35
-
36
- // / The flag which indicates whether we should not delete the file.
37
- bool Keep;
38
-
39
- StringRef getFilename () { return Filename; }
40
- explicit CleanupInstaller (StringRef Filename);
41
- ~CleanupInstaller ();
42
- } Installer;
44
+ CleanupInstaller Installer;
43
45
44
46
// / Storage for the stream, if we're owning our own stream. This is
45
47
// / intentionally declared after Installer.
Original file line number Diff line number Diff line change @@ -17,14 +17,14 @@ using namespace llvm;
17
17
18
18
static bool isStdout (StringRef Filename) { return Filename == " -" ; }
19
19
20
- ToolOutputFile:: CleanupInstaller::CleanupInstaller (StringRef Filename)
20
+ CleanupInstaller::CleanupInstaller (StringRef Filename)
21
21
: Filename(std::string(Filename)), Keep(false ) {
22
22
// Arrange for the file to be deleted if the process is killed.
23
23
if (!isStdout (Filename))
24
24
sys::RemoveFileOnSignal (Filename);
25
25
}
26
26
27
- ToolOutputFile:: CleanupInstaller::~CleanupInstaller () {
27
+ CleanupInstaller::~CleanupInstaller () {
28
28
if (isStdout (Filename))
29
29
return ;
30
30
You can’t perform that action at this time.
0 commit comments