LLVM: lib/Target/DirectX/DirectXAsmPrinter.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

21

22using namespace llvm;

23

24#define DEBUG_TYPE "asm-printer"

25

26namespace {

27

28

29

30class DXILAsmPrinter : public AsmPrinter {

31public:

33 std::unique_ptr Streamer)

34 : AsmPrinter(TM, std::move(Streamer)) {}

35

36 StringRef getPassName() const override { return "DXIL Assembly Printer"; }

37 void emitGlobalVariable(const GlobalVariable *GV) override;

38 bool runOnMachineFunction(MachineFunction &MF) override { return false; }

39};

40}

41

42void DXILAsmPrinter::emitGlobalVariable(const GlobalVariable *GV) {

43

45 return;

46

47 if (GV->getSection() == "llvm.metadata")

48 return;

50 MCSection *TheSection = getObjFileLowering().SectionForGlobal(GV, GVKind, TM);

51 OutStreamer->switchSection(TheSection);

53}

54

#define LLVM_EXTERNAL_VISIBILITY

LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeDirectXAsmPrinter()

Definition DirectXAsmPrinter.cpp:56

Module.h This file contains the declarations for the Module class.

static TableGen::Emitter::OptClass< SkeletonEmitter > X("gen-skeleton-class", "Generate example skeleton class")

This class is intended to be used as a driving class for all asm writers.

StringRef getSection() const

Get the custom section of this global if it has one.

bool hasSection() const

Check if this global has a custom object file section.

LLVM_ABI const DataLayout & getDataLayout() const

Get the data layout of the module this global belongs to.

const Constant * getInitializer() const

getInitializer - Return the initializer for this global variable.

bool hasInitializer() const

Definitions have initializers, declarations don't.

bool hasImplicitSection() const

Check if section name is present.

StringRef - Represent a constant reference to a string, i.e.

static SectionKind getKindForGlobal(const GlobalObject *GO, const TargetMachine &TM)

Classify the specified global variable into a set of target independent categories embodied in Sectio...

Primary interface to the complete machine description for the target machine.

This is an optimization pass for GlobalISel generic memory operations.

Target & getTheDirectXTarget()

RegisterAsmPrinter - Helper template for registering a target specific assembly printer,...