Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor code - tracker #52

Open
8 of 14 tasks
Rot127 opened this issue Mar 28, 2022 · 0 comments
Open
8 of 14 tasks

Refactor code - tracker #52

Rot127 opened this issue Mar 28, 2022 · 0 comments
Labels
refactor Code needs refactoring

Comments

@Rot127
Copy link
Member

Rot127 commented Mar 28, 2022

This issue tracks code to refactor.

  • Documentation of structs should be Doxygen compliant (//< instead of //)

  • Unify "instruction" abbreviationinstr -> insn.

  • Run clang-format also over hand-written files. In case they were edited with indent style ignoring editors (e.g. vim)

  • Enum names are sometimes all uppercase sometimes camel case. Should be all camel case.

  • Add const, RZ_BORROW etc. qualifiers to all functions.

  • Set internal functions to RZ_IPI instead of RZ_API

  • Fix grammar/spelling issues (handwritten -> hand-written)

  • Move the foloowing pattern in its own function

    with open("handwritten/hexagon_il_h/include.h") as include:
      set_pos_after_license(include)
      code += "".join(include.readlines())
  • Move the following pattern in its own function:

    if compare_src_to_old_src(code, path):
       self.unchanged_files.append(path)
       return
    with open(path, "w+") as dest:
       dest.writelines(code)
       log("analysis_hexagon.c written to {}".format(path), LogLevel.INFO)
  • Replaced "..".format() patterns with f"..." formatting in Generate instruction templates as C structs #60

  • Add functions which wrap code into a c-block/function/switch-case. (No longer needed since Generate instruction templates as C structs #60?)

  • Refactor parse_instruction()
    The method for parsing a Duplex or normal instruction are almost the same.
    The method should be in InstructionTemplate from which DuplexInstruction and Instruction inherit.

    Methods in question:

    def parse_instruction(self) -> None:

    def parse_instruction(self) -> None:

  • Update license date

  • Remove or include out-commented code (mostly logs)

@Rot127 Rot127 added the refactor Code needs refactoring label Mar 28, 2022
@Rot127 Rot127 changed the title Refactor code tracker Refactor code - tracker Mar 29, 2022
@Rot127 Rot127 mentioned this issue Apr 24, 2022
7 tasks
Rot127 added a commit that referenced this issue Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Code needs refactoring
Projects
None yet
Development

No branches or pull requests

1 participant