[llvm-commits] First draft of ARM EHABI support

Renato Golin Renato.Golin at arm.com
Tue Jan 25 02:15:49 PST 2011


On 01/24/11 23:51, Anton Korobeynikov wrote:
> Please find attached the first series of patches which start
> implementation of ARM EHABI support.

Hi Anton,

Very welcomed changes! :D

I'm not the one to advise you on MC, so I'll refrain myself to target
and exception model.


+    enum ExceptionsType { None, DwarfTable, DwarfCFI, SjLj, ARM };

Just a matter of preference, but can we call this EHABI rather than ARM? ;)


+++ b/include/llvm/MC/MCStreamer.h
+    /// ARM-related methods.
+    /// FIXME: Eventually we should have some "target MC streamer" and move
+    /// these methods there.
+    virtual void EmitFnStart();
+    virtual void EmitFnEnd();
+    virtual void EmitCantUnwind();
+    virtual void EmitPersonality(const MCSymbol *Personality);
+    virtual void EmitHandlerData();

Agreed, we need at least some target information in MC. Could be
callbacks, derived classes or even template parameters (policies).


+    // Emit references to personality.
+    if (const Function * Personality =
+        MMI->getPersonalities()[MMI->getPersonalityIndex()]) {
+      MCSymbol *PerSym = Asm->Mang->getSymbol(Personality);
+      Asm->OutStreamer.EmitSymbolAttribute(PerSym, MCSA_Global);
+      Asm->OutStreamer.EmitPersonality(PerSym);
+    }

It looks like you're following the GNU style (and using gnu
personalities). I assume you don't need the prel31 relocation at this
time, since GCC doesn't generate them (and GAS/LD guess them correctly).

But when using short and long ARM personalities, some relocations will
be needed in there...


+class ARMException : public DwarfException {

If I got it right, DwarfException now is the generic exception engine
(not just Dwarf) but it still has a few specific code like emitting
ULEBs in a specific way in ComputeActionTable, and lots of SjLj if/else
all around.

I'd suggest to change the class name to Exception?, extract
SjLjException from it and make sure the action table construction and
other appropriate bits are actually shared among all implementations.


.... The rest seems fine. I haven't dug that deep into it, but looks ok.

Thanks!!
--renato

-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.




More information about the llvm-commits mailing list