[llvm-commits] [llvm] r134577 - in /llvm/trunk: include/llvm/Target/TargetAsmInfo.h include/llvm/Target/TargetFrameLowering.h lib/MC/MCDwarf.cpp lib/Target/TargetAsmInfo.cpp lib/Target/X86/X86FrameLowering.cpp lib/Target/X86/X86FrameLowering.h

Bill Wendling isanbard at gmail.com
Wed Jul 6 21:40:55 PDT 2011


On Jul 6, 2011, at 6:59 PM, Chris Lattner wrote:

> On Jul 6, 2011, at 5:54 PM, Bill Wendling wrote:
> 
>> Author: void
>> Date: Wed Jul  6 19:54:13 2011
>> New Revision: 134577
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=134577&view=rev
>> Log:
>> Add a target hook to encode the compact unwind information.
> 
> Ok.
> 
>> +++ llvm/trunk/include/llvm/Target/TargetFrameLowering.h Wed Jul  6 19:54:13 2011
>> @@ -14,6 +14,7 @@
>> #ifndef LLVM_TARGET_TARGETFRAMELOWERING_H
>> #define LLVM_TARGET_TARGETFRAMELOWERING_H
>> 
>> +#include "llvm/MC/MCDwarf.h"
>> #include "llvm/CodeGen/MachineBasicBlock.h"
> 
> Please forward declare MCCFIInstruction.
> 
I can't. See below.

>> @@ -189,6 +190,14 @@
>>  ///
>>  virtual void processFunctionBeforeFrameFinalized(MachineFunction &MF) const {
>>  }
>> +
>> +  /// getCompactUnwindEncoding - Get the compact unwind encoding for the
>> +  /// function. Return 0 if the compact unwind isn't available.
>> +  virtual uint32_t getCompactUnwindEncoding(const std::vector<MCCFIInstruction>&,
>> +                                            int /*DataAlignmentFactor*/,
>> +                                            bool /*IsEH*/) const {
> 
> Please put names on these arguments like other stuff in this file.  Instead of taking a const vector, should this take an ArrayRef?
> 
Okay. Then I had to have the #include "llvm/MC/MCDwarf.h" in there or I get these errors:

/usr/include/c++/4.2.1/bits/stl_vector.h:493:41: error: arithmetic on a pointer to an incomplete type
      'llvm::MCCFIInstruction'
      { return *(this->_M_impl._M_start + __n); }
                 ~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/void/llvm/llvm.src/include/llvm/ADT/ArrayRef.h:65:37: note: in instantiation of member function
      'std::vector<llvm::MCCFIInstruction, std::allocator<llvm::MCCFIInstruction> >::operator[]' requested here
      : Data(Vec.empty() ? (T*)0 : &Vec[0]), Length(Vec.size()) {}
                                    ^
/Users/void/llvm/llvm.src/include/llvm/Target/TargetAsmInfo.h:89:42: note: in instantiation of member function
      'llvm::ArrayRef<llvm::MCCFIInstruction>::ArrayRef' requested here
    return TFI->getCompactUnwindEncoding(Instrs, DataAlignmentFactor, IsEH);
                                         ^
/Users/void/llvm/llvm.src/include/llvm/Target/TargetFrameLowering.h:25:9: note: forward declaration of
      'llvm::MCCFIInstruction'
  class MCCFIInstruction;
        ^

Otherwise, done.

-bw





More information about the llvm-commits mailing list