2010-02-15 22:37:53 +00:00
|
|
|
//==-- llvm/CodeGen/TargetLoweringObjectFileImpl.h - Object Info -*- C++ -*-==//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements classes used to handle lowerings specific to common
|
|
|
|
// object file formats.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_CODEGEN_TARGETLOWERINGOBJECTFILEIMPL_H
|
|
|
|
#define LLVM_CODEGEN_TARGETLOWERINGOBJECTFILEIMPL_H
|
|
|
|
|
|
|
|
#include "llvm/ADT/StringRef.h"
|
|
|
|
#include "llvm/MC/SectionKind.h"
|
|
|
|
#include "llvm/Target/TargetLoweringObjectFile.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class MachineModuleInfo;
|
|
|
|
class Mangler;
|
|
|
|
class MCAsmInfo;
|
|
|
|
class MCExpr;
|
|
|
|
class MCSection;
|
|
|
|
class MCSectionMachO;
|
|
|
|
class MCSymbol;
|
|
|
|
class MCContext;
|
|
|
|
class GlobalValue;
|
|
|
|
class TargetMachine;
|
|
|
|
|
|
|
|
|
|
|
|
class TargetLoweringObjectFileELF : public TargetLoweringObjectFile {
|
|
|
|
public:
|
2011-07-20 05:58:47 +00:00
|
|
|
virtual ~TargetLoweringObjectFileELF() {}
|
2011-04-16 03:51:21 +00:00
|
|
|
|
|
|
|
virtual void emitPersonalityValue(MCStreamer &Streamer,
|
|
|
|
const TargetMachine &TM,
|
|
|
|
const MCSymbol *Sym) const;
|
2011-01-23 05:43:40 +00:00
|
|
|
|
2010-02-15 22:37:53 +00:00
|
|
|
/// getSectionForConstant - Given a constant with the SectionKind, return a
|
|
|
|
/// section that it should be placed in.
|
|
|
|
virtual const MCSection *getSectionForConstant(SectionKind Kind) const;
|
|
|
|
|
|
|
|
|
|
|
|
virtual const MCSection *
|
|
|
|
getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
|
|
|
|
Mangler *Mang, const TargetMachine &TM) const;
|
|
|
|
|
|
|
|
virtual const MCSection *
|
|
|
|
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
|
|
|
|
Mangler *Mang, const TargetMachine &TM) const;
|
|
|
|
|
2010-03-11 19:41:58 +00:00
|
|
|
/// getExprForDwarfGlobalReference - Return an MCExpr to use for a reference
|
2010-02-15 22:37:53 +00:00
|
|
|
/// to the specified global variable from exception handling information.
|
|
|
|
///
|
|
|
|
virtual const MCExpr *
|
2010-03-11 19:41:58 +00:00
|
|
|
getExprForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
|
|
|
MachineModuleInfo *MMI, unsigned Encoding,
|
|
|
|
MCStreamer &Streamer) const;
|
2011-04-27 23:08:15 +00:00
|
|
|
|
|
|
|
// getCFIPersonalitySymbol - The symbol that gets passed to .cfi_personality.
|
|
|
|
virtual MCSymbol *
|
2011-04-27 23:17:57 +00:00
|
|
|
getCFIPersonalitySymbol(const GlobalValue *GV, Mangler *Mang,
|
|
|
|
MachineModuleInfo *MMI) const;
|
2010-02-15 22:37:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TargetLoweringObjectFileMachO : public TargetLoweringObjectFile {
|
|
|
|
public:
|
2011-07-20 05:58:47 +00:00
|
|
|
virtual ~TargetLoweringObjectFileMachO() {}
|
2011-01-23 05:43:40 +00:00
|
|
|
|
2010-02-15 22:37:53 +00:00
|
|
|
virtual const MCSection *
|
|
|
|
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
|
|
|
|
Mangler *Mang, const TargetMachine &TM) const;
|
|
|
|
|
|
|
|
virtual const MCSection *
|
|
|
|
getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
|
|
|
|
Mangler *Mang, const TargetMachine &TM) const;
|
|
|
|
|
|
|
|
virtual const MCSection *getSectionForConstant(SectionKind Kind) const;
|
|
|
|
|
|
|
|
/// shouldEmitUsedDirectiveFor - This hook allows targets to selectively
|
|
|
|
/// decide not to emit the UsedDirective for some symbols in llvm.used.
|
|
|
|
/// FIXME: REMOVE this (rdar://7071300)
|
|
|
|
virtual bool shouldEmitUsedDirectiveFor(const GlobalValue *GV,
|
|
|
|
Mangler *) const;
|
|
|
|
|
2010-03-11 19:41:58 +00:00
|
|
|
/// getExprForDwarfGlobalReference - The mach-o version of this method
|
2010-02-15 22:37:53 +00:00
|
|
|
/// defaults to returning a stub reference.
|
|
|
|
virtual const MCExpr *
|
2010-03-11 19:41:58 +00:00
|
|
|
getExprForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
|
|
|
MachineModuleInfo *MMI, unsigned Encoding,
|
|
|
|
MCStreamer &Streamer) const;
|
2010-02-21 20:28:15 +00:00
|
|
|
|
2011-04-27 23:08:15 +00:00
|
|
|
// getCFIPersonalitySymbol - The symbol that gets passed to .cfi_personality.
|
|
|
|
virtual MCSymbol *
|
2011-04-27 23:17:57 +00:00
|
|
|
getCFIPersonalitySymbol(const GlobalValue *GV, Mangler *Mang,
|
|
|
|
MachineModuleInfo *MMI) const;
|
2010-02-15 22:37:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TargetLoweringObjectFileCOFF : public TargetLoweringObjectFile {
|
|
|
|
public:
|
2011-07-20 05:58:47 +00:00
|
|
|
virtual ~TargetLoweringObjectFileCOFF() {}
|
2010-05-07 17:17:41 +00:00
|
|
|
|
2010-02-15 22:37:53 +00:00
|
|
|
virtual const MCSection *
|
|
|
|
getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
|
|
|
|
Mangler *Mang, const TargetMachine &TM) const;
|
|
|
|
|
|
|
|
virtual const MCSection *
|
|
|
|
SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
|
|
|
|
Mangler *Mang, const TargetMachine &TM) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|