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

Fixes some instances of auto usage with unintentional copy #4354

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FEXCore/Source/Interface/IR/AOTIR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ bool AOTIRCaptureCache::PostCompileCode(FEXCore::Core::InternalThreadState* Thre

auto LocalRIP = GuestRIP - AOTIRCacheEntry.VAFileStart;
auto LocalStartAddr = StartAddr - AOTIRCacheEntry.VAFileStart;
auto FileId = AOTIRCacheEntry.Entry->FileId;
const auto& FileId = AOTIRCacheEntry.Entry->FileId;

// The lambda is converted to std::function. This is tricky to refactor so it doesn't allocate memory through glibc.
// NOTE: unique_ptr must be passed as a raw pointer since std::function requires lambda captures to be copyable
Expand Down
2 changes: 1 addition & 1 deletion FEXCore/Source/Interface/IR/Passes/IRDumperPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class IRDumper final : public FEXCore::IR::Pass {
};

IRDumper::IRDumper() {
const auto DumpIRStr = DumpIR();
const auto& DumpIRStr = DumpIR();
if (DumpIRStr == "stderr" || DumpIRStr == "stdout" || DumpIRStr == "no") {
// Intentionally do nothing
} else if (DumpIRStr == "server") {
Expand Down
2 changes: 1 addition & 1 deletion FEXCore/Source/Utils/Telemetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void Initialize() {
return;
}

auto DataDirectory = Config::GetTelemetryDirectory();
const auto& DataDirectory = Config::GetTelemetryDirectory();

// Ensure the folder structure is created for our configuration
if (!FHU::Filesystem::Exists(DataDirectory) && !FHU::Filesystem::CreateDirectories(DataDirectory)) {
Expand Down
2 changes: 1 addition & 1 deletion Source/Tools/CodeSizeValidation/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ static bool TestInstructions(FEXCore::Context::Context* CTX, FEXCore::Core::Inte
bool ShouldShowCode = INSTStats->first.HostCodeInstructions != CurrentTest->ExpectedInstructionCount;

if (ShouldShowCode) {
for (auto Line : INSTStats->second) {
for (const auto& Line : INSTStats->second) {
LogMan::Msg::EFmt("\t{}", Line);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Tools/FEXLoader/FEXLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ int main(int argc, char** argv, char** const envp) {
LogMan::Throw::UnInstallHandler();
LogMan::Msg::UnInstallHandler();
} else {
auto LogFile = OutputLog();
const auto& LogFile = OutputLog();
// If stderr or stdout then we need to dup the FD
// In some cases some applications will close stderr and stdout
// then redirect the FD to either a log OR some cases just not use
Expand Down
2 changes: 1 addition & 1 deletion Source/Tools/FEXRootFSFetcher/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void ParseArguments(int argc, char** argv) {
}

if (Options.is_set_by_user("force_ui")) {
auto Option = Options["force_ui"];
const auto& Option = Options["force_ui"];
if (Option == "tty") {
UIOption = UIOverrideOption::TTY;
} else if (Option == "zenity") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ FileManager::FileManager(FEXCore::Context::Context* ctx)
}

// Now that we loaded the thunks object, walk through and ensure dependencies are enabled as well
auto ThunkGuestPath = Is64BitMode() ? ThunkGuestLibs() : ThunkGuestLibs32();
const auto& ThunkGuestPath = Is64BitMode() ? ThunkGuestLibs() : ThunkGuestLibs32();
for (const auto& DBObject : ThunkDB) {
if (!DBObject.second.Enabled) {
continue;
Expand Down
Loading