Author Topic: Clang CC  (Read 256077 times)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: Clang CC
« Reply #195 on: January 28, 2017, 12:10:14 pm »
Quote
Any reason why you added a new target? Can't we just update the existing targets?
With this target you can't run it trough the run button. But it creates a "install able" file you can distribute. The other targets let you to run codeblocks with the plugin installed there? I did want to modify this targets, because modifying them would may be break your workflow?

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: Clang CC
« Reply #196 on: January 28, 2017, 02:36:47 pm »
Hi,

I'm fine with it if the existing targets would make the plugin. I have my own version anyway since my installation always seem to be different than the generic one anyway.

Yves
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Clang CC
« Reply #197 on: January 28, 2017, 02:47:19 pm »
1) The name of the binary is somehow unlucky... ClangLib sounds as it is something from clang but not a code completion plugin. I think ccClang or something like this would be a
cb_clang_complete or something in this style is event better name.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: Clang CC
« Reply #198 on: January 28, 2017, 03:09:22 pm »
I really haven't chosen the name, I'm finishing the plugin that Alpha started. Reality is that this plugin does more than code-completion, it also does code-analysis and has the potential to do a lot more where I simply start the next feature when the previous is finished.

Yves
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Clang CC
« Reply #199 on: January 28, 2017, 04:26:36 pm »
I probably could have done a better job choosing the name; I had not considered "lib" being in important prefix/suffix...
The intent of the name was that this plugin would also support other functionality retrievable via clang, such as true semantic highlighting, auto suggest (+/- apply) fixes for warnings and errors, refactoring, reformatting, etc.

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: Clang CC
« Reply #200 on: January 28, 2017, 07:37:22 pm »
I probably could have done a better job choosing the name; I had not considered "lib" being in important prefix/suffix...
The intent of the name was that this plugin would also support other functionality retrievable via clang, such as true semantic highlighting, auto suggest (+/- apply) fixes for warnings and errors, refactoring, reformatting, etc.

I actually haven't found reformatting functionality in libclang, only using a cmd-line tool which is not based on libclang but on the 'continuously-changing' c++ classes...  I think if it is based on an external tool, it should have its own C::B plugin.

Yves
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Clang CC
« Reply #201 on: January 28, 2017, 08:29:40 pm »
Yes, clang-format doesn't require a compiler it is standalone tool or library...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: Clang CC
« Reply #202 on: January 30, 2017, 02:16:01 pm »
For the users of ClangCC, I just pushed a fix for an issue when a file that is not part of the project would be saved, caused a crash on ClangCC.

(on the staging branch)

Yves
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9693
Re: Clang CC
« Reply #203 on: February 19, 2017, 07:53:57 pm »
Dear Yves,

I've tried to compile this plugin on a more recent compiler. I suggest to apply the patch that is attached to:
- get rid of the deprecated auto_ptr
- simplify the singleton pattern
- fix an compiler error in non-PCH builds due to missing #include <iostream>

The patch applies to 2 files on the staging branch only: cclogger{.h/.cpp}.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Clang CC
« Reply #204 on: February 19, 2017, 08:01:54 pm »
Another note: if you're using CC_LOCKER_TRACK_TT_MTX_LOCK I guess you'll have to fix its implementation ;)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6034
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Clang CC
« Reply #205 on: February 21, 2017, 02:33:30 am »
Another note: if you're using CC_LOCKER_TRACK_TT_MTX_LOCK I guess you'll have to fix its implementation ;)
We should totally remove those lockers.  :)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Clang CC
« Reply #206 on: February 21, 2017, 09:14:00 am »
I've not said that. Just said that in some configurations they are broken (hint no locking is happening)!
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3352
Re: Clang CC
« Reply #207 on: February 22, 2017, 11:51:47 pm »
Hi, just i crash report i got lately very often:
Code
codeblocks.exe caused an Access Violation at location 4309DC03 Reading from location 4309DC03.

Registers:
eax=4309dc03 ebx=00000001 ecx=28c0e370 edx=28c0e370 esi=0028bad4 edi=00000000
eip=4309dc03 esp=0028ba50 ebp=0028baec iopl=0         nv up ei pl nz ac po nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00210216

AddrPC   Params
4309DC03 00000001 00000001 00000001
0A92A530 28C0E370 0028BA94 0028BB30  clanglib.dll!BeginHighlightOccurrences  [cclang-plugin/src/ClangLib/src/clangrefactoring.cpp @ 227]
   225:     ClTokenPosition loc(line + 1, pos - stc->PositionFromLine(line) + 1);
   226:
>  227:     m_pClangPlugin->RequestOccurrencesOf( translId,  ed->GetFilename(), loc );
   228: }
   229:
0A92A171 0028BC4C 02EFD728 0028BC7C  clanglib.dll!OnTimer  [cclang-plugin/src/ClangLib/src/clangrefactoring.cpp @ 181]
   179:
   180:     if (evId == idHighlightTimer)
>  181:         BeginHighlightOccurrences(ed);
   182:     else
   183:         event.Skip();

i get the crashes randomly, don't know if you can do something with it...
greetings

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: Clang CC
« Reply #208 on: February 23, 2017, 08:28:02 am »
I fixed a memory corruption crash yesterday in TreeMap::Remove() that might be the cause. Been reworking the index database lately and also built a tool that can dump the indexdb and now fixing many issues found by the tool. The goal is to depend less on libclang for things like the toolbar (scope menus) and goto-implementation and documentation-lookup. The problem with libclang is that you often need a translation unit to find various info and that takes a long time to create (essentially parsing/compiling the needed cpp file).

Yves
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: Clang CC
« Reply #209 on: February 23, 2017, 08:30:14 am »
Another note: if you're using CC_LOCKER_TRACK_TT_MTX_LOCK I guess you'll have to fix its implementation ;)
That's a file that I grabbed as-is from the regular CC plugin? I guess it has been updated there too?

Yves
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib