LLVM: lib/Remarks/RemarkLinker.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

20#include

21

22using namespace llvm;

24

25namespace llvm {

27}

28

31 if (Obj.isMachO())

33

35 "Unsupported file format.");

36}

37

43

46 if (!MaybeName)

49 continue;

50

52 return *Contents;

53 else

54 return Contents.takeError();

55 }

56 return std::optional{};

57}

58

59Remark &RemarkLinker::keep(std::unique_ptr Remark) {

61 auto Inserted = Remarks.insert(std::move(Remark));

62 return **Inserted.first;

63}

64

66 PrependPath = std::string(PrependPathIn);

67}

68

72 RemarkFormat, Buffer,

73 PrependPath ? std::make_optional(*PrependPath)

74 : std::nullopt);

75 if (!MaybeParser)

77

79

80 while (true) {

85 break;

86 }

87 return E;

88 }

89

91

92 if (shouldKeepRemark(**Next))

93 keep(std::move(*Next));

94 }

96}

97

101 if (!SectionOrErr)

103

104 if (std::optional Section = *SectionOrErr)

105 return link(*Section, RemarkFormat);

107}

108

112 std::move(const_cast<StringTable &>(StrTab)));

113 if (!MaybeSerializer)

114 return MaybeSerializer.takeError();

115

116 std::unique_ptrremarks::RemarkSerializer Serializer =

117 std::move(*MaybeSerializer);

118

120 Serializer->emit(R);

122}

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

Lightweight error class with error context and mandatory checking.

static ErrorSuccess success()

Create a success value.

Tagged union holding either a T or a Error.

Error takeError()

Take ownership of the stored error.

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

This class is the base class for all object file types.

This is a value type class that represents a single section in the list of sections in the object fil...

This class implements an extremely fast bulk output stream that can only output to a stream.

This is an optimization pass for GlobalISel generic memory operations.

cl::opt< std::string > RemarksFormat("lto-pass-remarks-format", cl::desc("The format used for serializing remarks (default: YAML)"), cl::value_desc("format"), cl::init("yaml"))

Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)

Create formatted StringError object.

FunctionAddr VTableAddr Next

void consumeError(Error Err)

Consume a Error without doing anything.