Skip to content

Commit e8420a4

Browse files
author
drswinghead
committed
revert to execute single module way. wait split mod feature completely
1 parent 1a16e36 commit e8420a4

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

ivm/clvmengine.cpp

+7-6
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ llvm::GenericValue ClvmEngine::execute3(llvm::Module *mod, QString func_entry, C
333333
llvm::Module *remod = cu->remod;
334334

335335
mman->add(QString::fromStdString(mod->getName().str()), mod);
336-
mman->add(QString::fromStdString(remod->getName().str()), remod);
336+
// mman->add(QString::fromStdString(remod->getName().str()), remod);
337337

338338
EE->finalizeObject();
339339
EE->runStaticConstructorsDestructors(false);
@@ -361,9 +361,10 @@ llvm::GenericValue ClvmEngine::execute3(llvm::Module *mod, QString func_entry, C
361361
}
362362
qDebug()<<"our fun:"<<func_entry<<mangle_name<<etyfn;
363363

364-
mangle_name = QString::fromStdString(remod->getName().str());
365-
etyfn = remod->getFunction(mangle_name.toStdString());
366-
qDebug()<<"our fun:"<<func_entry<<mangle_name<<etyfn;
364+
// 由于remod还没有完成,暂时忽略新的执行方式。
365+
QString mangle_name2 = QString::fromStdString(remod->getName().str());
366+
llvm::Function *etyfn2 = remod->getFunction(mangle_name2.toStdString());
367+
qDebug()<<"our fun:"<<func_entry<<mangle_name2<<etyfn2;
367368

368369
std::vector<llvm::GenericValue> args;
369370
llvm::GenericValue rgv = EE->runFunction(etyfn, args);
@@ -372,8 +373,8 @@ llvm::GenericValue ClvmEngine::execute3(llvm::Module *mod, QString func_entry, C
372373
EE->runStaticConstructorsDestructors(true);
373374
// cleanups
374375
bool bret = false;
375-
bret = mman->remove(QString::fromStdString(remod->getName().str()));
376-
// bret &= mman->remove(QString::fromStdString(mod->getName().str()));
376+
// bret |= mman->remove(QString::fromStdString(remod->getName().str()));
377+
bret |= mman->remove(QString::fromStdString(mod->getName().str()));
377378
qDebug()<<bret;
378379

379380
qDebug()<<"run code done."<<llvm::GVTOP(rgv)<<rgv.IntVal.getZExtValue();

tests/test_056.rb

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env ruby
2+
# -*- coding: utf-8 -*-
3+
4+
a = File.absolute_path(File.dirname(__FILE__))
5+
ret = require "#{a}/test_init.rb"
6+
7+
### write your test code here
8+
# only test basic gui app
9+
10+
def main()
11+
a = Qt5::QApplication.new(ARGV.count, ARGV)
12+
w = Qt5::QWidget.new()
13+
w.show()
14+
a.exec
15+
end
16+
17+
main()

0 commit comments

Comments
 (0)