Skip to content

Commit e8171e6

Browse files
author
Steffen Larsen
committed
Simplications
Signed-off-by: Steffen Larsen <[email protected]>
1 parent cb39cb8 commit e8171e6

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

libclc/utils/libclc-remangler/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ target_include_directories(libclc-remangler PRIVATE
1111
${CMAKE_SOURCE_DIR}/../clang/include
1212
${CMAKE_BINARY_DIR}/tools/clang/include)
1313

14-
clang_target_link_libraries(libclc-remangler PRIVATE clangBasic)
14+
clang_target_link_libraries(libclc-remangler PRIVATE clangBasic)

libclc/utils/libclc-remangler/LibclcRemangler.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,7 @@ class TargetTypeReplacements {
492492
bool createAlias(Module *M, std::string originalMangledName,
493493
const itanium_demangle::Node *functionTree,
494494
TargetTypeReplacements replacements) {
495-
// If there are no alias replacements, this is trivially done.
496-
if (replacements.getAliasTypeReplacements().empty())
497-
return true;
498-
499-
Remangler ATR =
500-
Remangler(functionTree, replacements.getAliasTypeReplacements());
495+
Remangler ATR{functionTree, replacements.getAliasTypeReplacements()};
501496
std::string RemangledAliasName = ATR.remangle();
502497

503498
if (ATR.hasFailed())
@@ -530,13 +525,8 @@ bool remangleFunction(Function &func, Module *M,
530525
return false;
531526
}
532527

533-
// No type replacements
534-
if (replacements.getParameterTypeReplacements().empty())
535-
return true;
536-
537528
// Try to change the parameter types in the function name using the mappings.
538-
Remangler R =
539-
Remangler(FunctionTree, replacements.getParameterTypeReplacements());
529+
Remangler R{FunctionTree, replacements.getParameterTypeReplacements()};
540530
std::string RemangledName = R.remangle();
541531

542532
if (R.hasFailed())
@@ -606,4 +596,4 @@ int main(int argc, const char **argv) {
606596
// Declare success.
607597
Out->keep();
608598
return 0;
609-
}
599+
}

0 commit comments

Comments
 (0)