[llvm-commits] [llvm] r80146 - in /llvm/trunk/lib/CodeGen: AsmPrinter/DwarfException.cpp MachineModuleInfo.cpp

Xerxes RĂ„nby xerxes at zafena.se
Thu Aug 27 04:06:54 PDT 2009


Hi one thought about using MMI methods:

CodeGen/AsmPrinter/AsmPrinter.cpp
In AsmPrinter::doInitialization

  if (MAI->doesSupportDebugInformation() ||
      MAI->doesSupportExceptionHandling()) {
    MMI = getAnalysisIfAvailable<MachineModuleInfo>();
    if (MMI)
      MMI->AnalyzeModule(M);
    DW = getAnalysisIfAvailable<DwarfWriter>();
    if (DW)
      DW->BeginModule(&M, MMI, O, this, MAI);
  }

MMI might be 0 in DW!

and
AsmPrinter/DwarfWriter.cpp:  DE->BeginModule(M, MMI);

MMI might be 0 in DE!

Would not this require that we at least do
if(MMI) in DwarfException before using MMI methods?

Cheers
Xerxes

Eric Christopher skrev:
> Author: echristo
> Date: Wed Aug 26 16:30:49 2009
> New Revision: 80146
>
> URL: http://llvm.org/viewvc/llvm-project?rev=80146&view=rev
> Log:
> If we're emitting additional CIEs due to personality functions
> don't emit the default one. Explicitly check for the NULL
> CIE later.
>
> Modified:
>     llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
>     llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp
>
> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=80146&r1=80145&r2=80146&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original)
> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Wed Aug 26 16:30:49 2009
> @@ -203,7 +203,7 @@
>  
>      // If there is a personality and landing pads then point to the language
>      // specific data area in the exception table.
> -    if (EHFrameInfo.PersonalityIndex) {
> +    if (MMI->getPersonalities()[0] != NULL) {
>        Asm->EmitULEB128Bytes(4);
>        Asm->EOL("Augmentation size");
>  
>
> Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=80146&r1=80145&r2=80146&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original)
> +++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Wed Aug 26 16:30:49 2009
> @@ -44,7 +44,7 @@
>  , CallsUnwindInit(0)
>  , DbgInfoAvailable(false)
>  {
> -  // Always emit "no personality" info
> +  // Always emit some info, by default "no personality" info.
>    Personalities.push_back(NULL);
>  }
>  MachineModuleInfo::~MachineModuleInfo() {
> @@ -148,7 +148,12 @@
>      if (Personalities[i] == Personality)
>        return;
>  
> -  Personalities.push_back(Personality);
> +  // If this is the first personality we're adding go
> +  // ahead and add it at the beginning.
> +  if (Personalities[0] == NULL)
> +    Personalities[0] = Personality;
> +  else
> +    Personalities.push_back(Personality);
>  }
>  
>  /// addCatchTypeInfo - Provide the catch typeinfo for a landing pad.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>   




More information about the llvm-commits mailing list