Work on CPU, codegen skeleton, and thunk.
This commit is contained in:
@@ -61,6 +61,7 @@ def discover_commands():
|
||||
'pull': PullCommand(),
|
||||
'gyp': GypCommand(),
|
||||
'build': BuildCommand(),
|
||||
'xethunk': XethunkCommand(),
|
||||
'clean': CleanCommand(),
|
||||
'nuke': NukeCommand(),
|
||||
}
|
||||
@@ -379,6 +380,33 @@ class BuildCommand(Command):
|
||||
return 0
|
||||
|
||||
|
||||
class XethunkCommand(Command):
|
||||
"""'xethunk' command."""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(XethunkCommand, self).__init__(
|
||||
name='xethunk',
|
||||
help_short='Updates the xethunk.bc file.',
|
||||
*args, **kwargs)
|
||||
|
||||
def execute(self, args, cwd):
|
||||
print 'Building xethunk...'
|
||||
print ''
|
||||
|
||||
path = 'src/cpu/xethunk/xethunk'
|
||||
result = shell_call('clang -emit-llvm -O0 -c %s.c -o %s.bc' % (path, path),
|
||||
throw_on_error=False)
|
||||
if result != 0:
|
||||
return result
|
||||
|
||||
shell_call('build/llvm/release/bin/llvm-dis %s.bc -o %s.ll' % (path, path))
|
||||
|
||||
shell_call('cat %s.ll' % (path))
|
||||
|
||||
print 'Success!'
|
||||
return 0
|
||||
|
||||
|
||||
class CleanCommand(Command):
|
||||
"""'clean' command."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user