LLVM: lib/Transforms/Utils/StripGCRelocates.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

21

22using namespace llvm;

23

25

26 if (F.isDeclaration())

27 return false;

29

30

35 }

36

37

39 Value *OrigPtr = GCRel->getDerivedPtr();

40 Value *ReplaceGCRel = OrigPtr;

41

42

43

44 if (GCRel->getType() != OrigPtr->getType())

45 ReplaceGCRel = new BitCastInst(OrigPtr, GCRel->getType(), "cast", GCRel->getIterator());

46

47

48

49

50 GCRel->replaceAllUsesWith(ReplaceGCRel);

51 GCRel->eraseFromParent();

52 }

53 return !GCRelocates.empty();

54}

55

60

61

62

65 return PA;

66}

Expand Atomic instructions

static bool stripGCRelocates(Function &F)

Definition StripGCRelocates.cpp:24

This class represents a no-op cast from one type to another.

Represents analyses that only rely on functions' control flow.

Represents calls to the gc.relocate intrinsic.

A set of analyses that are preserved following a run of a transformation pass.

static PreservedAnalyses all()

Construct a special preserved set that preserves all passes.

PreservedAnalyses & preserveSet()

Mark an analysis set as preserved.

void push_back(const T &Elt)

This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.

PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)

Definition StripGCRelocates.cpp:56

LLVM Value Representation.

Type * getType() const

All values are typed, get the type of this value.

This is an optimization pass for GlobalISel generic memory operations.

decltype(auto) dyn_cast(const From &Val)

dyn_cast - Return the argument parameter cast to the specified type.

bool isa(const From &Val)

isa - Return true if the parameter to the template is an instance of one of the template type argu...

AnalysisManager< Function > FunctionAnalysisManager

Convenience typedef for the Function analysis manager.