Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
llvm-epi-0.8
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Roger Ferrer
llvm-epi-0.8
Commits
c4bbc710
Commit
c4bbc710
authored
21 years ago
by
Chris Lattner
Browse files
Options
Downloads
Patches
Plain Diff
Fix the JIT in the Nightly tester. This was not a fun bug to track down.
See the comments in the patch for details. llvm-svn: 7457
parent
eaee3259
No related branches found
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/Timer.cpp
+14
-2
14 additions, 2 deletions
llvm/lib/Support/Timer.cpp
llvm/support/lib/Support/Timer.cpp
+14
-2
14 additions, 2 deletions
llvm/support/lib/Support/Timer.cpp
with
28 additions
and
4 deletions
llvm/lib/Support/Timer.cpp
+
14
−
2
View file @
c4bbc710
...
...
@@ -17,7 +17,18 @@
#include
<functional>
#include
<fstream>
static
std
::
string
LibSupportInfoOutputFilename
;
// getLibSupportInfoOutputFilename - This ugly hack is brought to you courtesy
// of constructor/destructor ordering being unspecified by C++. Basically the
// problem is that a Statistic<> object gets destroyed, which ends up calling
// 'GetLibSupportInfoOutputFile()' (below), which calls this function.
// LibSupportInfoOutputFilename used to be a global variable, but sometimes it
// would get destroyed before the Statistic, causing havoc to ensue. We "fix"
// this by creating the string the first time it is needed and never destroying
// it.
static
std
::
string
&
getLibSupportInfoOutputFilename
()
{
static
std
::
string
*
LibSupportInfoOutputFilename
=
new
std
::
string
();
return
*
LibSupportInfoOutputFilename
;
}
namespace
{
#ifdef HAVE_MALLINFO
...
...
@@ -30,7 +41,7 @@ namespace {
cl
::
opt
<
std
::
string
,
true
>
InfoOutputFilename
(
"info-output-file"
,
cl
::
desc
(
"File to append -stats and -timer output to"
),
cl
::
Hidden
,
cl
::
location
(
LibSupportInfoOutputFilename
));
cl
::
Hidden
,
cl
::
location
(
get
LibSupportInfoOutputFilename
()
));
}
static
TimerGroup
*
DefaultTimerGroup
=
0
;
...
...
@@ -232,6 +243,7 @@ void Timer::print(const Timer &Total, std::ostream &OS) {
// GetLibSupportInfoOutputFile - Return a file stream to print our output on...
std
::
ostream
*
GetLibSupportInfoOutputFile
()
{
std
::
string
&
LibSupportInfoOutputFilename
=
getLibSupportInfoOutputFilename
();
if
(
LibSupportInfoOutputFilename
.
empty
())
return
&
std
::
cerr
;
if
(
LibSupportInfoOutputFilename
==
"-"
)
...
...
This diff is collapsed.
Click to expand it.
llvm/support/lib/Support/Timer.cpp
+
14
−
2
View file @
c4bbc710
...
...
@@ -17,7 +17,18 @@
#include
<functional>
#include
<fstream>
static
std
::
string
LibSupportInfoOutputFilename
;
// getLibSupportInfoOutputFilename - This ugly hack is brought to you courtesy
// of constructor/destructor ordering being unspecified by C++. Basically the
// problem is that a Statistic<> object gets destroyed, which ends up calling
// 'GetLibSupportInfoOutputFile()' (below), which calls this function.
// LibSupportInfoOutputFilename used to be a global variable, but sometimes it
// would get destroyed before the Statistic, causing havoc to ensue. We "fix"
// this by creating the string the first time it is needed and never destroying
// it.
static
std
::
string
&
getLibSupportInfoOutputFilename
()
{
static
std
::
string
*
LibSupportInfoOutputFilename
=
new
std
::
string
();
return
*
LibSupportInfoOutputFilename
;
}
namespace
{
#ifdef HAVE_MALLINFO
...
...
@@ -30,7 +41,7 @@ namespace {
cl
::
opt
<
std
::
string
,
true
>
InfoOutputFilename
(
"info-output-file"
,
cl
::
desc
(
"File to append -stats and -timer output to"
),
cl
::
Hidden
,
cl
::
location
(
LibSupportInfoOutputFilename
));
cl
::
Hidden
,
cl
::
location
(
get
LibSupportInfoOutputFilename
()
));
}
static
TimerGroup
*
DefaultTimerGroup
=
0
;
...
...
@@ -232,6 +243,7 @@ void Timer::print(const Timer &Total, std::ostream &OS) {
// GetLibSupportInfoOutputFile - Return a file stream to print our output on...
std
::
ostream
*
GetLibSupportInfoOutputFile
()
{
std
::
string
&
LibSupportInfoOutputFilename
=
getLibSupportInfoOutputFilename
();
if
(
LibSupportInfoOutputFilename
.
empty
())
return
&
std
::
cerr
;
if
(
LibSupportInfoOutputFilename
==
"-"
)
...
...
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