Setting the optimization on a single source file.

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Setting the optimization on a single source file.

ソリューションへジャンプ
2,214件の閲覧回数
MTBer
Contributor I
I would like to find out how to set the optimization of a single source file in my project for speed and leave the rest the same as it currently stands (size). 
 
I have searched through this forum and help files and already spend hours on this.  Searched all the settings in the IDE etc.  I'm dying here
 
It's for an HCS12XE device and Codewarrior version 4.6.  Hope this is enough info.
 
Then, off the topic, my email address changed a few years back, but are still forwarded to my new address.  One day soon, the alias will be killed and then I won't be able to log into this forum anymore.  Does anyone know how to change this email address?
 
Thanks in advance for all you great answers,
MTBer
ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
1,223件の閲覧回数
CrasyCat
Specialist III
Hello
 
Well this can work for single functions as well.
 
Just enclose the function (or functions) you want to optimize for execution time between the 2 pragmas.
 
Option is activated with pragma OPTION ADD and desactivated with pragma OPTION DEL.
 
So you can decide whether you want to use it for 1 function, a set of functions or the whole module :smileywink:
 
CrasyCat

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,223件の閲覧回数
CrasyCat
Specialist III
Hello
 
In order to activate a compiler option for a single module you can use the pragma OPTION.
 
Put following line before the implementation of the first function in the module
#pragma OPTION ADD OptimizeTime "-Ot"
 
Place following line at the end of the module
 
#pragma OPTION DEL OptimizeTime
 
In order to get your email address changed you need to submit a Service Request with Categorie = Web and Topic = Email Address Change

Click here to submit a service request.
CrasyCat
1,223件の閲覧回数
MTBer
Contributor I
Hi CrasyCat,
 
Thanks a lot for your response.  I have tried it, but unfortunately my code jump from 10k to 40k for this source file and now I am struggling to make it fit.
 
This will only work down to a function level or can I use it inside a function as well?
 
Thanks again,
MTBer
0 件の賞賛
返信
1,224件の閲覧回数
CrasyCat
Specialist III
Hello
 
Well this can work for single functions as well.
 
Just enclose the function (or functions) you want to optimize for execution time between the 2 pragmas.
 
Option is activated with pragma OPTION ADD and desactivated with pragma OPTION DEL.
 
So you can decide whether you want to use it for 1 function, a set of functions or the whole module :smileywink:
 
CrasyCat
0 件の賞賛
返信