Closed mewmew closed 4 years ago
Oh neat. Thanks for the very useful issue.
Done. If you build from master you will be able to get it yourself. I wasn't 100% sure what to put for the complexity estimate so I went with loop terminator and bitwise operations. The full list is included below,
"llvm.loop",
"br ",
"switch ",
"indirectbr ",
"invoke ",
"callbr ",
"resume ",
"catchswitch ",
"catchret ",
"cleanupret ",
"shl ",
"lshr ",
"ashr ",
"and ",
"or ",
"xor "
Let me know if that seems right or if something is missing and ill add it in. Otherwise this will be pushed out in the next release.
@boyter wow, that's incredible! Very happy to see LLVM IR support integrated into scc
! And can't believe how quickly you managed to do so.
For the sample repo I listed, it works perfectly!
───────────────────────────────────────────────────────────────────────────────
Language Files Lines Blanks Comments Code Complexity
───────────────────────────────────────────────────────────────────────────────
C 1 3 0 0 3 0
Go 1 177 18 62 97 15
LLVM IR 1 5 0 1 4 0
───────────────────────────────────────────────────────────────────────────────
Total 3 185 18 63 104 15
───────────────────────────────────────────────────────────────────────────────
Estimated Cost to Develop $2,508
Estimated Schedule Effort 1.576498 months
Estimated People Required 0.188513
───────────────────────────────────────────────────────────────────────────────
Thanks a lot and have a most lovely summer :)
Cheers, Robin
No problem at all. One of the things I wanted with it was to make adding languages easy and thankfully that works.
Great to hear it worked for you. However I am going into winter now seeing as I live in Australia :)
Great to hear it worked for you. However I am going into winter now seeing as I live in Australia :)
Haha. Happy winter season then! Enjoy the ski slopes, hot chocolate and cozy blankets while reading a favourite book or two :)
Cheers, Robin
Hah it never gets that cold here really. I went to the beach the other day! Cheers for responding.
Hah it never gets that cold here really. I went to the beach the other day! Cheers for responding.
Haha. Living in Sweden, it never occurred to me that winter can be anyting other than snow and ice :)
Happy winter regardless! Enjoy the beach!
My first impression of
scc
is that it is a very accurate recreation of the behaviour of cloc with a clear focus on performance.Therefore, this feature request may be outside the scope of
scc
ascloc
does not support LLVM IR either. However, I still wanted to open the issue to start the discussion.I ran an analysis of a sample project and the results of
scc
andcloc
were indeed identical (whilescc
also added information about code complexity).scc output
cloc output
As visible in the example above, both
scc
andsloc
accurately analyzed the C and Go source code and indeed presented identical line number metrics. Also noticeable is thatscc
completes in 1/20 of the time.Lacking from both of these results is however the line numbers of the LLVM IR source code also present in the sample project.
The contents of
foo.ll
is as follows:As such, if
scc
where to add support for the LLVM IR assembly language, the results would look as follows:Wish you all the best and thanks for working on this project!
Cheers, Robin