Mikhail Glushenkov wrote:> > > 2. Is there anyway to call a C++ hook from inside actions? > > for example > > (actions (case > > (not_empty "Wl,"), (append_cmd "$CALL(Myhook)" ))) > > Not yet, this is something I'm working on right now. >Hi Mikhail, Did you get a chance to do something about this?> > > BTW, I've implemented the OptionPreprocessor feature that we discussed > some time ago. See the documentation for details. >is it a good idea to include something called "set_option"? For example if none of O0, O1, O2 or O3 are specified on the command line, We can just make O2 as default by using the set_option. - Sanjiv> -- > () ascii ribbon campaign - against html e-mail > /\ www.asciiribbon.org - against proprietary attachments >
Hi Sanjiv, On Tue, Dec 8, 2009 at 4:41 AM, Sanjiv Gupta <sanjiv.gupta at microchip.com> wrote:> Mikhail Glushenkov wrote: >> >> > 2. Is there anyway to call a C++ hook from inside actions? >> > for example >> > (actions (case >> > (not_empty "Wl,"), (append_cmd "$CALL(Myhook)" ))) >> >> Not yet, this is something I'm working on right now. >> > Hi Mikhail, > Did you get a chance to do something about this?Sorry for the delay, will be ready Real Soon Now. I've implemented 'forward_transformed_value', though.>> BTW, I've implemented the OptionPreprocessor feature that we discussed >> some time ago. See the documentation for details. >> > is it a good idea to include something called "set_option"? For example if > none of O0, O1, O2 or O3 are specified on the command line, We can just make > O2 as default by using the set_option.Yes, I think it's a good idea. For now you can simulate this with 'init' (enable -O2 by default and make -O0 + -O2 = -O0, and -O2 + -O3 = -O3). -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments
Mikhail Glushenkov a écrit :> Hi Sanjiv, > > On Tue, Dec 8, 2009 at 4:41 AM, Sanjiv Gupta <sanjiv.gupta at microchip.com> wrote: >> Mikhail Glushenkov wrote: >>>> 2. Is there anyway to call a C++ hook from inside actions? >>>> for example >>>> (actions (case >>>> (not_empty "Wl,"), (append_cmd "$CALL(Myhook)" ))) >>> Not yet, this is something I'm working on right now.Sorry, I didn't see this thread but I have a patch for that. It's more a hack than really a new feature but that works well... Index: LLVMCConfigurationEmitter.cpp ==================================================================--- LLVMCConfigurationEmitter.cpp (révision 90849) +++ LLVMCConfigurationEmitter.cpp (copie de travail) @@ -1794,9 +1814,24 @@ StrVector Out; llvm::SplitString(Cmd, Out); - for (StrVector::const_iterator B = Out.begin(), E = Out.end(); - B != E; ++B) - O.indent(IndentLevel) << "vec.push_back(\"" << *B << "\");\n"; + StrVector StrVec; + TokenizeCmdline(Cmd, StrVec); + StrVector::const_iterator I = StrVec.begin(), E = StrVec.end(); + for (; I != E; ++I) { + const std::string& cmd = *I; + if (cmd.at(0) == '$') { + O << "vec.push_back("; + I=SubstituteSpecialCommands(I,E,O); + O << ");\n"; + } + else{ + O.indent(IndentLevel) << "vec.push_back(\"" << *I << "\");\n"; + } + } + + //for (StrVector::const_iterator B = Out.begin(), E = Out.end(); + // B != E; ++B) + // O.indent(IndentLevel) << "vec.push_back(\"" << *B << "\");\n"; } void onForward (const DagInit& Dag,