Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
llvm-epi
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Roger Ferrer
llvm-epi
Commits
34c9610e
Commit
34c9610e
authored
21 years ago
by
Misha Brukman
Browse files
Options
Downloads
Patches
Plain Diff
Fixed space issues, code alignment, tabs -> spaces.
llvm-svn: 8755
parent
b5d41c4a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
llvm/lib/Support/SystemUtils.cpp
+11
-11
11 additions, 11 deletions
llvm/lib/Support/SystemUtils.cpp
llvm/support/lib/Support/SystemUtils.cpp
+11
-11
11 additions, 11 deletions
llvm/support/lib/Support/SystemUtils.cpp
with
22 additions
and
22 deletions
llvm/lib/Support/SystemUtils.cpp
+
11
−
11
View file @
34c9610e
...
@@ -36,14 +36,14 @@ bool isExecutableFile(const std::string &ExeFileName) {
...
@@ -36,14 +36,14 @@ bool isExecutableFile(const std::string &ExeFileName) {
return
Buf
.
st_mode
&
S_IXOTH
;
return
Buf
.
st_mode
&
S_IXOTH
;
}
}
/// FindExecutable - Find a named executable, giving the argv[0] of program
/// FindExecutable - Find a named executable, giving the argv[0] of program
/// being executed. This allows us to find another LLVM tool if it is built into
/// being executed. This allows us to find another LLVM tool if it is built
/// the same directory, but that directory is neither the current directory, nor
/// into the same directory, but that directory is neither the current
/// in the PATH. If the executable cannot be found, return an empty string.
/// directory, nor in the PATH. If the executable cannot be found, return an
/// empty string.
///
///
std
::
string
FindExecutable
(
const
std
::
string
&
ExeName
,
std
::
string
FindExecutable
(
const
std
::
string
&
ExeName
,
const
std
::
string
&
ProgramPath
)
{
const
std
::
string
&
ProgramPath
)
{
// First check the directory that bugpoint is in. We can do this if
// First check the directory that bugpoint is in. We can do this if
// BugPointPath contains at least one / character, indicating that it is a
// BugPointPath contains at least one / character, indicating that it is a
// relative path to bugpoint itself.
// relative path to bugpoint itself.
...
@@ -93,7 +93,7 @@ static void RedirectFD(const std::string &File, int FD) {
...
@@ -93,7 +93,7 @@ static void RedirectFD(const std::string &File, int FD) {
int
InFD
=
open
(
File
.
c_str
(),
FD
==
0
?
O_RDONLY
:
O_WRONLY
|
O_CREAT
,
0666
);
int
InFD
=
open
(
File
.
c_str
(),
FD
==
0
?
O_RDONLY
:
O_WRONLY
|
O_CREAT
,
0666
);
if
(
InFD
==
-
1
)
{
if
(
InFD
==
-
1
)
{
std
::
cerr
<<
"Error opening file '"
<<
File
<<
"' for "
std
::
cerr
<<
"Error opening file '"
<<
File
<<
"' for "
<<
(
FD
==
0
?
"input"
:
"output"
)
<<
"!
\n
"
;
<<
(
FD
==
0
?
"input"
:
"output"
)
<<
"!
\n
"
;
exit
(
1
);
exit
(
1
);
}
}
...
@@ -108,9 +108,9 @@ static void RedirectFD(const std::string &File, int FD) {
...
@@ -108,9 +108,9 @@ static void RedirectFD(const std::string &File, int FD) {
/// It returns the return value of the program, or -1 if a timeout is detected.
/// It returns the return value of the program, or -1 if a timeout is detected.
///
///
int
RunProgramWithTimeout
(
const
std
::
string
&
ProgramPath
,
const
char
**
Args
,
int
RunProgramWithTimeout
(
const
std
::
string
&
ProgramPath
,
const
char
**
Args
,
const
std
::
string
&
StdInFile
,
const
std
::
string
&
StdInFile
,
const
std
::
string
&
StdOutFile
,
const
std
::
string
&
StdOutFile
,
const
std
::
string
&
StdErrFile
)
{
const
std
::
string
&
StdErrFile
)
{
// FIXME: install sigalarm handler here for timeout...
// FIXME: install sigalarm handler here for timeout...
...
@@ -141,12 +141,12 @@ int RunProgramWithTimeout(const std::string &ProgramPath, const char **Args,
...
@@ -141,12 +141,12 @@ int RunProgramWithTimeout(const std::string &ProgramPath, const char **Args,
if
(
errno
==
EINTR
)
{
if
(
errno
==
EINTR
)
{
static
bool
FirstTimeout
=
true
;
static
bool
FirstTimeout
=
true
;
if
(
FirstTimeout
)
{
if
(
FirstTimeout
)
{
std
::
cout
<<
std
::
cout
<<
"*** Program execution timed out! This mechanism is designed to handle
\n
"
"*** Program execution timed out! This mechanism is designed to handle
\n
"
" programs stuck in infinite loops gracefully. The -timeout option
\n
"
" programs stuck in infinite loops gracefully. The -timeout option
\n
"
" can be used to change the timeout threshold or disable it completely
\n
"
" can be used to change the timeout threshold or disable it completely
\n
"
" (with -timeout=0). This message is only displayed once.
\n
"
;
" (with -timeout=0). This message is only displayed once.
\n
"
;
FirstTimeout
=
false
;
FirstTimeout
=
false
;
}
}
return
-
1
;
// Timeout detected
return
-
1
;
// Timeout detected
}
}
...
...
This diff is collapsed.
Click to expand it.
llvm/support/lib/Support/SystemUtils.cpp
+
11
−
11
View file @
34c9610e
...
@@ -36,14 +36,14 @@ bool isExecutableFile(const std::string &ExeFileName) {
...
@@ -36,14 +36,14 @@ bool isExecutableFile(const std::string &ExeFileName) {
return
Buf
.
st_mode
&
S_IXOTH
;
return
Buf
.
st_mode
&
S_IXOTH
;
}
}
/// FindExecutable - Find a named executable, giving the argv[0] of program
/// FindExecutable - Find a named executable, giving the argv[0] of program
/// being executed. This allows us to find another LLVM tool if it is built into
/// being executed. This allows us to find another LLVM tool if it is built
/// the same directory, but that directory is neither the current directory, nor
/// into the same directory, but that directory is neither the current
/// in the PATH. If the executable cannot be found, return an empty string.
/// directory, nor in the PATH. If the executable cannot be found, return an
/// empty string.
///
///
std
::
string
FindExecutable
(
const
std
::
string
&
ExeName
,
std
::
string
FindExecutable
(
const
std
::
string
&
ExeName
,
const
std
::
string
&
ProgramPath
)
{
const
std
::
string
&
ProgramPath
)
{
// First check the directory that bugpoint is in. We can do this if
// First check the directory that bugpoint is in. We can do this if
// BugPointPath contains at least one / character, indicating that it is a
// BugPointPath contains at least one / character, indicating that it is a
// relative path to bugpoint itself.
// relative path to bugpoint itself.
...
@@ -93,7 +93,7 @@ static void RedirectFD(const std::string &File, int FD) {
...
@@ -93,7 +93,7 @@ static void RedirectFD(const std::string &File, int FD) {
int
InFD
=
open
(
File
.
c_str
(),
FD
==
0
?
O_RDONLY
:
O_WRONLY
|
O_CREAT
,
0666
);
int
InFD
=
open
(
File
.
c_str
(),
FD
==
0
?
O_RDONLY
:
O_WRONLY
|
O_CREAT
,
0666
);
if
(
InFD
==
-
1
)
{
if
(
InFD
==
-
1
)
{
std
::
cerr
<<
"Error opening file '"
<<
File
<<
"' for "
std
::
cerr
<<
"Error opening file '"
<<
File
<<
"' for "
<<
(
FD
==
0
?
"input"
:
"output"
)
<<
"!
\n
"
;
<<
(
FD
==
0
?
"input"
:
"output"
)
<<
"!
\n
"
;
exit
(
1
);
exit
(
1
);
}
}
...
@@ -108,9 +108,9 @@ static void RedirectFD(const std::string &File, int FD) {
...
@@ -108,9 +108,9 @@ static void RedirectFD(const std::string &File, int FD) {
/// It returns the return value of the program, or -1 if a timeout is detected.
/// It returns the return value of the program, or -1 if a timeout is detected.
///
///
int
RunProgramWithTimeout
(
const
std
::
string
&
ProgramPath
,
const
char
**
Args
,
int
RunProgramWithTimeout
(
const
std
::
string
&
ProgramPath
,
const
char
**
Args
,
const
std
::
string
&
StdInFile
,
const
std
::
string
&
StdInFile
,
const
std
::
string
&
StdOutFile
,
const
std
::
string
&
StdOutFile
,
const
std
::
string
&
StdErrFile
)
{
const
std
::
string
&
StdErrFile
)
{
// FIXME: install sigalarm handler here for timeout...
// FIXME: install sigalarm handler here for timeout...
...
@@ -141,12 +141,12 @@ int RunProgramWithTimeout(const std::string &ProgramPath, const char **Args,
...
@@ -141,12 +141,12 @@ int RunProgramWithTimeout(const std::string &ProgramPath, const char **Args,
if
(
errno
==
EINTR
)
{
if
(
errno
==
EINTR
)
{
static
bool
FirstTimeout
=
true
;
static
bool
FirstTimeout
=
true
;
if
(
FirstTimeout
)
{
if
(
FirstTimeout
)
{
std
::
cout
<<
std
::
cout
<<
"*** Program execution timed out! This mechanism is designed to handle
\n
"
"*** Program execution timed out! This mechanism is designed to handle
\n
"
" programs stuck in infinite loops gracefully. The -timeout option
\n
"
" programs stuck in infinite loops gracefully. The -timeout option
\n
"
" can be used to change the timeout threshold or disable it completely
\n
"
" can be used to change the timeout threshold or disable it completely
\n
"
" (with -timeout=0). This message is only displayed once.
\n
"
;
" (with -timeout=0). This message is only displayed once.
\n
"
;
FirstTimeout
=
false
;
FirstTimeout
=
false
;
}
}
return
-
1
;
// Timeout detected
return
-
1
;
// Timeout detected
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment