LLVM: lib/AsmParser/AsmParserContext.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

10

11namespace llvm {

12

13std::optional

15 if (auto FIt = Functions.find(F); FIt != Functions.end())

16 return FIt->second;

17 return std::nullopt;

18}

19

20std::optional

22 if (auto BBIt = Blocks.find(BB); BBIt != Blocks.end())

23 return BBIt->second;

24 return std::nullopt;

25}

26

27std::optional

29 if (auto IIt = Instructions.find(I); IIt != Instructions.end())

30 return IIt->second;

31 return std::nullopt;

32}

33

36 for (auto &[F, Loc] : Functions) {

37 if (Loc.contains(Query))

38 return F;

39 }

40 return nullptr;

41}

42

46

49 for (auto &[BB, Loc] : Blocks) {

50 if (Loc.contains(Query))

51 return BB;

52 }

53 return nullptr;

54}

55

59

62 for (auto &[I, Loc] : Instructions) {

63 if (Loc.contains(Query))

64 return I;

65 }

66 return nullptr;

67}

68

73

76 return Functions.insert({F, Loc}).second;

77}

78

81 return Blocks.insert({BB, Loc}).second;

82}

83

86 return Instructions.insert({I, Loc}).second;

87}

88

89}

BasicBlock * getBlockAtLocation(const FileLocRange &) const

Get the block at the requested location range.

Definition AsmParserContext.cpp:48

bool addInstructionLocation(Instruction *, const FileLocRange &)

Definition AsmParserContext.cpp:84

bool addBlockLocation(BasicBlock *, const FileLocRange &)

Definition AsmParserContext.cpp:79

LLVM_ABI std::optional< FileLocRange > getFunctionLocation(const Function *) const

Definition AsmParserContext.cpp:14

Function * getFunctionAtLocation(const FileLocRange &) const

Get the function at the requested location range.

Definition AsmParserContext.cpp:35

LLVM_ABI std::optional< FileLocRange > getInstructionLocation(const Instruction *) const

Definition AsmParserContext.cpp:28

Instruction * getInstructionAtLocation(const FileLocRange &) const

Get the instruction at the requested location range.

Definition AsmParserContext.cpp:61

LLVM_ABI std::optional< FileLocRange > getBlockLocation(const BasicBlock *) const

Definition AsmParserContext.cpp:21

bool addFunctionLocation(Function *, const FileLocRange &)

Definition AsmParserContext.cpp:74

LLVM Basic Block Representation.

This is an optimization pass for GlobalISel generic memory operations.

Struct holding a semiopen range [Start; End)

Struct holding Line:Column location.