While going through this patch (http://forums.next.codeblocks.org/index.php/topic,17130.msg120875.html#msg120875), I noticed that using namespace is only (or at least, seems to be only) parsed in the global scope. Is this a known problem? Is it supposed to work (currently)?
Quote from: Alpha on April 10, 2013, 08:15:53 PM
While going through this patch (http://forums.next.codeblocks.org/index.php/topic,17130.msg120875.html#msg120875), I noticed that using namespace is only (or at least, seems to be only) parsed in the global scope. Is this a known problem?
Note that parser in batch mode (parsing local files) has no need to handle "using namespace" statements in function bodies.
There is another function:bool ParserThread::ParseBufferForUsingNamespace(const wxString& buffer, wxArrayString& result) which handle local using namespace statements.
Another thing: I think TokenIdxSet is better than "std::vector<int>" in the patch.
Quote from: ollydbg on April 11, 2013, 02:15:32 AM
There is another function:bool ParserThread::ParseBufferForUsingNamespace(const wxString& buffer, wxArrayString& result) which handle local using namespace statements.
Yes, however on line 414, function bodies are skipped. (I think I have a solution though.)
else if (token==ParserConsts::opbrace)
{
SkipBlock();
}
Quote from: ollydbg on April 11, 2013, 02:15:32 AM
Another thing: I think TokenIdxSet is better than "std::vector<int>" in the patch.
Yes (I have a few other local modifications also).
Quote from: ollydbg on April 11, 2013, 02:15:32 AM
Another thing: I think TokenIdxSet is better than "std::vector<int>" in the patch.
Yes. This patch needs a clean-up. I did it in my local copy as well...
Attached patch includes tidied up version of the previous patch (by p2rkw), and parsing of function bodies for using namespace directives.
Feedback appreciated.
Committed.
(By the way, I tested a full rebuild of CodeBlocks-unix.cbp on my new computer I just assembled... total time: 39 seconds!!)
Quote from: Alpha on April 13, 2013, 07:12:16 PM
total time: 39 seconds!!)
Really
seconds? :o
Specs please!
Quotecodeblocks --rebuild CodeBlocks-unix.cbp
-------------- Clean: tinyXML in Code::Blocks wx2.8.x - Unix (compiler: GNU GCC Compiler)---------------
[...]
-------------- Clean: To-do in Code::Blocks wx2.8.x - Unix (compiler: GNU GCC Compiler)---------------
-------------- Build: tinyXML in Code::Blocks wx2.8.x - Unix (compiler: GNU GCC Compiler)---------------
ccache-g++ -Wall -g -fmessage-length=0 -fexceptions -Winvalid-pch -Ulinux -Uunix -fPIC -I/usr/lib64/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_
[...]
Process terminated with status 0 (0 minute(s), 38 second(s))
0 error(s), 0 warning(s) (0 minute(s), 38 second(s))
Core i7 quadcore (8 virtual cores), 32 GB Ram, parallel build with 9 threads, build with ccache, with pure g++/gcc it needs 1 minute 46 seconds .
39 seconds was with pure GCC. Adding ccache reduces my time to 31 seconds.
Quote from: MortenMacFly on April 13, 2013, 08:09:55 PM
Specs please!
Dual SSD's in RAID 0, 16 GB RAM, and i7-3970X (hexacore, 12 virtual cores, 4.2 GHz).
...I won't tell you mine then. :'(
Quote from: MortenMacFly on April 15, 2013, 06:48:49 AM
...I won't tell you mine then. :'(
:D
I am sure you will get a new computer in a year or two with whatever the newest processor architecture will be, that will blow away the rest of our statistics ;).