Improve manual indexing performance when indexing non objective C code. One question I have is all Darwin compilers currently support the apple DWARF indexes, so do we even need the objective C parsing code here?
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
I suppose one could compile Objective-C code on Linux using GCC.
source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp | ||
---|---|---|
255 ↗ | (On Diff #204175) | Since check_objc is only used here, I think it would be better for readability to say if (cu_language == eLanguageTypeObjC || cu_language == eLanguageTypeObjC_plus_plus) here |
source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp | ||
---|---|---|
255 ↗ | (On Diff #204175) | This is a hot loop. As long as the compiler will compute this once when optimizations are enabled, I am fine with inlining it into the if statement. But I pulled it out of the loop to ensure it only gets calculated once. |
This was intended as a reply to:
One question I have is all Darwin compilers currently support the apple DWARF indexes, so do we even need the objective C parsing code here?
source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp | ||
---|---|---|
255 ↗ | (On Diff #204175) | cu_language is a constant, so it should be safe for the compiler to hoist the computation. Also, this computation is so cheap that I'd rather optimize for readability. |
Also, i think I remember hearing that the apple indexes will not be emitted for jitted code, even on apple platforms, but this was just in passing, so I may not be totally correct here.
Let compiler hoist "cu_language == eLanguageTypeObjC || cu_language == eLanguageTypeObjC_plus_plus" by inlining it into if statement so it is more readable.