Skip to content

Commit

Permalink
llvmir2hll/c_hll_writer: project new function type implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Kubov committed Feb 5, 2020
1 parent acce421 commit 7d9bcfd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/llvmir2hll/hll/hll_writers/c_hll_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1258,17 +1258,19 @@ bool CHLLWriter::emitStandardFunctionPrototypes() {
//
// - All functions with bodies.
// - All functions marked as "user-defined".
// - All functions marked as "decompiler-defined".
//
// Notes:
//
// - We cannot consider just user-defined functions because there may be
// no config file from which this information is taken (in such case, we
// would emit no function prototypes at all).
// - We cannot consider just user-defined and decompiler-defined functions
// because there may be no config file from which this information is
// taken (in such case, we would emit no function prototypes at all).
FuncSet funcsToEmit(
module->func_definition_begin(),
module->func_definition_end()
);
addToSet(module->getUserDefinedFuncs(), funcsToEmit);
addToSet(module->getDecompilerDefinedFuncs(), funcsToEmit);
return emitFunctionPrototypes(funcsToEmit);
}

Expand Down
2 changes: 2 additions & 0 deletions tests/llvmir2hll/hll/hll_writers/hll_writer_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ void HLLWriterTests::SetUp() {
.WillByDefault(Return(NO_LINE_RANGE));
ON_CALL(*configMock, isUserDefinedFunc(_))
.WillByDefault(Return(false));
ON_CALL(*configMock, isDecompilerDefinedFunc(_))
.WillByDefault(Return(false));
ON_CALL(*configMock, isStaticallyLinkedFunc(_))
.WillByDefault(Return(false));
ON_CALL(*configMock, isDynamicallyLinkedFunc(_))
Expand Down

0 comments on commit 7d9bcfd

Please sign in to comment.