[Lldb-commits] [PATCH] D13578: Allow generic arm ArchSpec to merge with specific arm ArchSpec; allow Cortex M0-7's to always force thumb mode

Renato Golin via lldb-commits lldb-commits at lists.llvm.org
Sat Oct 10 05:18:44 PDT 2015


rengolin added a comment.

In http://reviews.llvm.org/D13578#264072, @jasonmolenda wrote:

> I'm trying to rewrite IsAlwaysThumbInstructions() to use the information that llvm already has, as per Renato's suggestion.  The MCSubtargetInfo has a getFeatureBits() method which can indicate ARM::FeatureNoARM.  I'm still having a little bit of trouble getting it to build, the ARMFeatures.h is in an unusual location and it indirectly pulls in ARMGenRegisterInfo.inc, ARMGenInstrInfo.inc, and ARMGenSubtargetInfo.inc from the build dir - I'll need to update xcode and cmake to add the $(llvm-build-dir)/lib/Target/ARM/ to the include path for these to be found.  I might not have time to finish this tonight, we'll see.


The target information classes depend on table-generated files, so if you were not building them before, you'll need to do that now. I though LLDB was doing this already, that's why I suggested lightly. But ultimately, I believe you *don't* want to have your own target description anyway, so it's a move that you'd have to do anyway.

> I'm not sure how expensive it is to make an llvm::Target and get the MCSubtargetInfo out of that every call; I may need to save something in an ArchSpec ivar.  Maybe just the results of the FeatureBits check.


I'm not sure you should be doing that. Those calls normally involve traversing tables and correlating information. Even though that gets optimised pretty well, it's not something that you want to be delaying delicate hardware handling of breakpoints, run states etc.

I'd guess you could have a local cache with only the information you need, and you initialise it from the target description classes once. You may end up with some duplication, but hopefully, it won't be too much and it'll be a lot faster.

--renato


Repository:
  rL LLVM

http://reviews.llvm.org/D13578





More information about the lldb-commits mailing list