[llvm-commits] [llvm] r132033 - in /llvm/trunk: include/llvm/Attributes.h include/llvm/Function.h include/llvm/Target/TargetOptions.h lib/AsmParser/LLLexer.cpp lib/AsmParser/LLParser.cpp lib/AsmParser/LLToken.h lib/CodeGen/AsmPrinter/ARMException.cpp lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/Target/PowerPC/PPCFrameLowering.cpp lib/Target/TargetMachine.cpp lib/Target/X86/X86FrameLowering.cpp lib/Target/XCore/XCoreRegisterInfo.cpp lib/VMCore/Attributes.cpp test/CodeGen/X86/hidden-vis-pic.ll

Duncan Sands baldrick at free.fr
Tue May 24 23:38:01 PDT 2011


Hi Rafael,

> --- llvm/trunk/include/llvm/Attributes.h (original)
> +++ llvm/trunk/include/llvm/Attributes.h Tue May 24 22:44:17 2011
> @@ -67,6 +67,20 @@
>                                             ///alignstack(1))
>   const Attributes Hotpatch    = 1<<29;     ///<  Function should have special
>                                             ///'hotpatch' sequence in prologue
> +const Attributes UWTable     = 1<<30;     ///<  Function must be in a unwind
> +                                          ///table
> +
> +/// Note that uwtable is about the ABI or the user mandating an entry in the
> +/// unwind table. The nounwind attribute is about an exception passing by the
> +/// function.
> +/// In a theoretical system that uses tables for profiling and sjlj for
> +/// exceptions, they would be fully independent. In a normal system that
> +/// uses tables for both, the semantics are:
> +/// nil                = Needs an entry because an exception might pass by.
> +/// nounwind           = No need for an entry
> +/// ehframe            = Needs an entry because the ABI says so and because
> +///                      an exception might pass by.
> +/// ehframe + nounwind = Needs an entry because the ABI says so.

the comment still takes about ehframe rather than uwtable.

> --- llvm/trunk/include/llvm/Function.h (original)
> +++ llvm/trunk/include/llvm/Function.h Tue May 24 22:44:17 2011
> @@ -253,6 +253,22 @@
>       else removeFnAttr(Attribute::NoUnwind);
>     }
>
> +  /// @brief True if the ABI mandates this function be in a unwind table.

Since it might be the user that set this rather than the ABI requiring it,
how about "True if this function has the nounwind attribute".

> +  bool hasUWTable() const {
> +    return hasFnAttr(Attribute::UWTable);
> +  }
> +  void setHasUWTable(bool HasUWTable = true) {
> +    if (HasUWTable)
> +      addFnAttr(Attribute::UWTable);
> +    else
> +      removeFnAttr(Attribute::UWTable);
> +  }
> +
> +  /// @brief True if this function needs in a unwind table.

needs in a -> needs a

Ciao, Duncan.



More information about the llvm-commits mailing list