Skip to content

clang/utils/TableGen/ClangOptionDocEmitter.cpp:220: Pointless string copy ? #94373

Open
@dcb314

Description

Static analyser cppcheck says:

clang/utils/TableGen/ClangOptionDocEmitter.cpp:220:41: performance: Function parameter 'Heading' should be passed by const reference. [passedByValue]

Source code is

void emitHeading(int Depth, std::string Heading, raw_ostream &OS) {

Maybe better code:

void emitHeading(int Depth, const std::string & Heading, raw_ostream &OS) {

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions