Projects
home:Eustace:branches:Eulaceura:Factory
pin-server
_service:obs_scm:0021-Pin-server-The-lto-flag-i...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0021-Pin-server-The-lto-flag-is-used-to-control-the-pass-.patch of Package pin-server
From 28e8bb19d239ba0e223a980c85da41950fb97295 Mon Sep 17 00:00:00 2001 From: d00573793 <dingguangya1@huawei.com> Date: Fri, 3 Mar 2023 11:12:44 +0800 Subject: [PATCH 21/23] [Pin-server] The lto flag is used to control the pass execution. diff --git a/include/user/StructReorder.h b/include/user/StructReorder.h index 3938121..d3e4486 100644 --- a/include/user/StructReorder.h +++ b/include/user/StructReorder.h @@ -30,10 +30,8 @@ public: StructReorderPass() : PluginOptBase(HANDLE_MANAGER_SETUP) { } - bool Gate() - { - return true; - } + bool Gate(); + int DoOptimize() { uint64_t *fun = (uint64_t *)GetFuncAddr(); diff --git a/user/StructReorder.cpp b/user/StructReorder.cpp index a23d256..612a093 100644 --- a/user/StructReorder.cpp +++ b/user/StructReorder.cpp @@ -81,4 +81,18 @@ int StructReorderPass::DoOptimize(uint64_t *fun) ProcessStructReorder(fun); return 0; } + +bool StructReorderPass::Gate() +{ + PluginServerAPI pluginAPI; + if (pluginAPI.IsLtoOptimize()) { + fprintf(stderr, "\n The LTO flag is open \n"); + return true; + } + if (pluginAPI.IsWholeProgram()) { + fprintf(stderr, "\n The whole program flag is open \n"); + return true; + } + return false; +} } \ No newline at end of file -- 2.33.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2