diff options
Diffstat (limited to 'include/llvm/Target/TargetELFWriterInfo.h')
-rw-r--r-- | include/llvm/Target/TargetELFWriterInfo.h | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/include/llvm/Target/TargetELFWriterInfo.h b/include/llvm/Target/TargetELFWriterInfo.h index 809846a0fb..6037826555 100644 --- a/include/llvm/Target/TargetELFWriterInfo.h +++ b/include/llvm/Target/TargetELFWriterInfo.h @@ -14,11 +14,10 @@ #ifndef LLVM_TARGET_TARGETELFWRITERINFO_H #define LLVM_TARGET_TARGETELFWRITERINFO_H -#include "llvm/Target/TargetData.h" -#include "llvm/Target/TargetMachine.h" -#include "llvm/Function.h" - namespace llvm { + class Function; + class TargetData; + class TargetMachine; //===--------------------------------------------------------------------===// // TargetELFWriterInfo @@ -50,21 +49,14 @@ namespace llvm { EM_X86_64 = 62 // AMD64 }; - explicit TargetELFWriterInfo(TargetMachine &tm) : TM(tm) {} - virtual ~TargetELFWriterInfo() {} + explicit TargetELFWriterInfo(TargetMachine &tm); + virtual ~TargetELFWriterInfo(); unsigned short getEMachine() const { return EMachine; } /// getFunctionAlignment - Returns the alignment for function 'F', targets /// with different alignment constraints should overload this method - virtual unsigned getFunctionAlignment(const Function *F) const { - const TargetData *TD = TM.getTargetData(); - unsigned FnAlign = F->getAlignment(); - unsigned TDAlign = TD->getPointerABIAlignment(); - unsigned Align = std::max(FnAlign, TDAlign); - assert(!(Align & (Align-1)) && "Alignment is not a power of two!"); - return Align; - } + virtual unsigned getFunctionAlignment(const Function *F) const; }; } // end llvm namespace |