Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
38d32bb9
Commit
38d32bb9
authored
May 30, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make some things forwards-compatible with newer LLVM revisions
parent
2254da9f
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
15 deletions
+25
-15
src/codegen/codegen.cpp
src/codegen/codegen.cpp
+1
-4
src/codegen/dis.cpp
src/codegen/dis.cpp
+6
-4
src/codegen/opt/inliner.cpp
src/codegen/opt/inliner.cpp
+4
-0
src/codegen/stackmaps.cpp
src/codegen/stackmaps.cpp
+4
-4
src/codegen/unwinding.cpp
src/codegen/unwinding.cpp
+7
-3
src/runtime/builtin_modules/builtins.cpp
src/runtime/builtin_modules/builtins.cpp
+1
-0
tools/git_svn_gotorev.py
tools/git_svn_gotorev.py
+2
-0
No files found.
src/codegen/codegen.cpp
View file @
38d32bb9
...
...
@@ -155,20 +155,17 @@ public:
continue
;
llvm
::
StringRef
name
;
uint64_t
addr
,
size
,
offset
;
uint64_t
addr
,
size
;
code
=
I
->
getName
(
name
);
assert
(
!
code
);
code
=
I
->
getAddress
(
addr
);
assert
(
!
code
);
code
=
I
->
getSize
(
size
);
assert
(
!
code
);
code
=
I
->
getFileOffset
(
offset
);
assert
(
!
code
);
if
(
name
==
".text"
)
continue
;
// printf("%lx %lx %lx %s\n", addr, addr + size, offset, name.data());
g
.
func_addr_registry
.
registerFunction
(
name
.
data
(),
(
void
*
)
addr
,
size
,
NULL
);
}
}
...
...
src/codegen/dis.cpp
View file @
38d32bb9
...
...
@@ -85,7 +85,11 @@ PystonJITEventListener::PystonJITEventListener() {
assert
(
CE
);
bool
verbose
=
false
;
#if LLVMREV < 208205
llvm
::
MCStreamer
*
streamer
=
target
->
createAsmStreamer
(
*
Ctx
,
llvm
::
ferrs
(),
verbose
,
true
,
true
,
IP
,
CE
,
TAB
,
true
);
#else
llvm
::
MCStreamer
*
streamer
=
target
->
createAsmStreamer
(
*
Ctx
,
llvm
::
ferrs
(),
verbose
,
true
,
IP
,
CE
,
TAB
,
true
);
#endif
assert
(
streamer
);
streamer
->
InitSections
();
streamer
->
SwitchSection
(
Ctx
->
getObjectFileInfo
()
->
getTextSection
());
...
...
@@ -178,16 +182,14 @@ void PystonJITEventListener::NotifyObjectEmitted(const llvm::ObjectImage& Obj) {
for
(
llvm
::
object
::
symbol_iterator
I
=
Obj
.
begin_symbols
(),
E
=
Obj
.
end_symbols
();
I
!=
E
;)
{
llvm
::
StringRef
name
;
uint64_t
addr
,
size
,
offset
=
0
;
uint64_t
addr
,
size
;
code
=
I
->
getName
(
name
);
assert
(
!
code
);
code
=
I
->
getAddress
(
addr
);
assert
(
!
code
);
code
=
I
->
getSize
(
size
);
assert
(
!
code
);
code
=
I
->
getFileOffset
(
offset
);
assert
(
!
code
);
printf
(
"%lx %lx %lx %s
\n
"
,
addr
,
addr
+
size
,
offset
,
name
.
data
());
printf
(
"%lx %lx %s
\n
"
,
addr
,
addr
+
size
,
name
.
data
());
#if LLVMREV < 200442
I
=
I
.
increment
(
code
);
#else
...
...
src/codegen/opt/inliner.cpp
View file @
38d32bb9
...
...
@@ -58,7 +58,11 @@ public:
assert
(
gv
->
getLinkage
()
!=
llvm
::
GlobalVariable
::
PrivateLinkage
);
r
=
new_module
->
getOrInsertGlobal
(
gv
->
getName
(),
gv
->
getType
()
->
getElementType
());
}
else
if
(
llvm
::
GlobalAlias
*
alias
=
llvm
::
dyn_cast
<
llvm
::
GlobalAlias
>
(
v
))
{
#if LLVMREV < 209040
llvm
::
Value
*
addressee
=
llvm
::
cast
<
llvm
::
Constant
>
(
materializeValueFor
(
alias
->
getAliasedGlobal
()));
#else
llvm
::
Value
*
addressee
=
llvm
::
cast
<
llvm
::
Constant
>
(
materializeValueFor
(
alias
->
getAliasee
()));
#endif
assert
(
addressee
);
assert
(
alias
->
getType
()
==
addressee
->
getType
());
r
=
addressee
;
...
...
src/codegen/stackmaps.cpp
View file @
38d32bb9
...
...
@@ -68,14 +68,14 @@ void StackmapJITEventListener::NotifyObjectEmitted(const llvm::ObjectImage& Obj)
assert
(
!
code
);
if
(
name
==
"__LLVM_StackMaps"
)
{
uint64_t
stackmap_
offset
=
0
;
code
=
I
->
get
FileOffset
(
stackmap_offset
);
uint64_t
stackmap_
address
=
0
;
code
=
I
->
get
Address
(
stackmap_address
);
assert
(
!
code
);
// code = I->getSize(stackmap_size);
// assert(stackmap_size > 0);
// assert(!code);
if
(
VERBOSITY
()
>=
2
)
printf
(
"Found the stackmaps at stackmap_
offset 0x%lx
\n
"
,
stackmap_offset
);
printf
(
"Found the stackmaps at stackmap_
address 0x%lx
\n
"
,
stackmap_address
);
assert
(
cur_map
==
NULL
);
cur_map
=
new
StackMap
();
...
...
@@ -93,7 +93,7 @@ void StackmapJITEventListener::NotifyObjectEmitted(const llvm::ObjectImage& Obj)
const
StackMap
::
Record
::
LiveOut
*
record_liveout
;
const
StackMap
::
StackSizeRecord
*
size_record
;
}
ptr
;
const
int8_t
*
start_ptr
=
ptr
.
i8
=
(
const
int8_t
*
)
Obj
.
getData
().
data
()
+
stackmap_offset
;
const
int8_t
*
start_ptr
=
ptr
.
i8
=
(
const
int8_t
*
)
stackmap_address
;
cur_map
->
header
=
*
ptr
.
u32
++
;
// header
...
...
src/codegen/unwinding.cpp
View file @
38d32bb9
...
...
@@ -78,8 +78,6 @@ public:
llvm
::
error_code
ec
;
for
(
llvm
::
object
::
symbol_iterator
I
=
Obj
.
begin_symbols
(),
E
=
Obj
.
end_symbols
();
I
!=
E
&&
!
ec
;
++
I
)
{
std
::
string
SourceFileName
;
llvm
::
object
::
SymbolRef
::
Type
SymType
;
if
(
I
->
getType
(
SymType
))
continue
;
...
...
@@ -94,8 +92,14 @@ public:
if
(
I
->
getSize
(
Size
))
continue
;
#if LLVMREV < 208921
llvm
::
DILineInfoTable
lines
=
Context
->
getLineInfoForAddressRange
(
Addr
,
Size
,
llvm
::
DILineInfoSpecifier
::
FunctionName
|
llvm
::
DILineInfoSpecifier
::
FileLineInfo
|
llvm
::
DILineInfoSpecifier
::
AbsoluteFilePath
);
#else
llvm
::
DILineInfoTable
lines
=
Context
->
getLineInfoForAddressRange
(
Addr
,
Size
,
llvm
::
DILineInfoSpecifier
::
FunctionName
|
llvm
::
DILineInfoSpecifier
::
FileLineInfo
);
Addr
,
Size
,
llvm
::
DILineInfoSpecifier
(
llvm
::
DILineInfoSpecifier
::
FileLineInfoKind
::
AbsoluteFilePath
,
llvm
::
DILineInfoSpecifier
::
FunctionNameKind
::
LinkageName
));
#endif
for
(
int
i
=
0
;
i
<
lines
.
size
();
i
++
)
{
// printf("%s:%d, %s: %lx\n", lines[i].second.getFileName(), lines[i].second.getLine(),
// lines[i].second.getFunctionName(), lines[i].first);
...
...
src/runtime/builtin_modules/builtins.cpp
View file @
38d32bb9
...
...
@@ -13,6 +13,7 @@
// limitations under the License.
#include <algorithm>
#include <cstddef>
#include "codegen/compvars.h"
#include "core/ast.h"
...
...
tools/git_svn_gotorev.py
View file @
38d32bb9
...
...
@@ -79,6 +79,8 @@ if __name__ == "__main__":
continue
if
patch_fn
.
startswith
(
"LICENSE"
):
continue
if
"Update-TailCallElim"
in
patch_fn
and
svn_rev
>=
208017
:
continue
patch_fn
=
os
.
path
.
abspath
(
os
.
path
.
join
(
patch_dir
,
patch_fn
))
code
=
subprocess
.
call
([
"git"
,
"am"
,
patch_fn
],
cwd
=
repo
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment