LLVM: lib/ObjCopy/ConfigManager.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

12

13using namespace llvm;

15

17 if (Common.ExtractSection.empty())

19 "option is not supported for ELF");

20 return ELF;

21}

22

24 if (Common.SplitDWO.empty() || Common.SymbolsPrefix.empty() ||

25 Common.SymbolsPrefixRemove.empty() || Common.SymbolsToSkip.empty() ||

26 Common.AllocSectionsPrefix.empty() || Common.KeepSection.empty() ||

27 Common.SymbolsToGlobalize.empty() || Common.SymbolsToKeep.empty() ||

28 Common.SymbolsToLocalize.empty() || Common.SymbolsToWeaken.empty() ||

29 Common.SymbolsToKeepGlobal.empty() || Common.SectionsToRename.empty() ||

30 Common.SetSectionAlignment.empty() || Common.SetSectionType.empty() ||

33 Common.DecompressDebugSections ||

35 Common.SymbolsToAdd.empty() || Common.GapFill != 0 ||

36 Common.PadTo != 0 || Common.ChangeSectionLMAValAll != 0 ||

37 Common.ChangeSectionAddress.empty() || Common.ExtractSection.empty())

39 "option is not supported for COFF");

40

42}

43

45 if (Common.SplitDWO.empty() || Common.SymbolsPrefix.empty() ||

46 Common.SymbolsPrefixRemove.empty() ||

47 Common.AllocSectionsPrefix.empty() || Common.KeepSection.empty() ||

48 Common.SymbolsToKeep.empty() || Common.SectionsToRename.empty() ||

49 Common.UnneededSymbolsToRemove.empty() ||

50 Common.SetSectionAlignment.empty() || Common.SetSectionFlags.empty() ||

51 Common.SetSectionType.empty() || Common.ExtractDWO ||

53 Common.StripNonAlloc || Common.StripSections ||

54 Common.DecompressDebugSections || Common.StripUnneeded ||

56 Common.SymbolsToAdd.empty() || Common.GapFill != 0 ||

57 Common.PadTo != 0 || Common.ChangeSectionLMAValAll != 0 ||

58 Common.ChangeSectionAddress.empty() || Common.ExtractSection.empty())

60 "option is not supported for MachO");

61

63}

64

66 if (Common.AddGnuDebugLink.empty() || Common.ExtractPartition ||

67 Common.SplitDWO.empty() || Common.SymbolsPrefix.empty() ||

68 Common.SymbolsPrefixRemove.empty() || Common.SymbolsToSkip.empty() ||

69 Common.AllocSectionsPrefix.empty() ||

71 Common.SymbolsToGlobalize.empty() || Common.SymbolsToLocalize.empty() ||

72 Common.SymbolsToKeep.empty() || Common.SymbolsToRemove.empty() ||

73 Common.UnneededSymbolsToRemove.empty() ||

74 Common.SymbolsToWeaken.empty() || Common.SymbolsToKeepGlobal.empty() ||

75 Common.SectionsToRename.empty() || Common.SetSectionAlignment.empty() ||

76 Common.SetSectionFlags.empty() || Common.SetSectionType.empty() ||

77 Common.SymbolsToRename.empty() || Common.GapFill != 0 ||

78 Common.PadTo != 0 || Common.ChangeSectionLMAValAll != 0 ||

79 Common.ChangeSectionAddress.empty() || Common.ExtractSection.empty())

81 "only flags for section dumping, removal, and "

82 "addition are supported");

83

85}

86

88 if (Common.AddGnuDebugLink.empty() || Common.ExtractPartition ||

89 Common.SplitDWO.empty() || Common.SymbolsPrefix.empty() ||

90 Common.SymbolsPrefixRemove.empty() || Common.SymbolsToSkip.empty() ||

91 Common.AllocSectionsPrefix.empty() ||

93 Common.DumpSection.empty() || Common.SymbolsToAdd.empty() ||

94 Common.KeepSection.empty() || Common.OnlySection.empty() ||

95 Common.ToRemove.empty() || Common.SymbolsToGlobalize.empty() ||

96 Common.SymbolsToKeep.empty() || Common.SymbolsToLocalize.empty() ||

97 Common.SymbolsToRemove.empty() ||

98 Common.UnneededSymbolsToRemove.empty() ||

99 Common.SymbolsToWeaken.empty() || Common.SymbolsToKeepGlobal.empty() ||

100 Common.SectionsToRename.empty() || Common.SetSectionAlignment.empty() ||

101 Common.SetSectionFlags.empty() || Common.SetSectionType.empty() ||

102 Common.SymbolsToRename.empty() || Common.ExtractDWO ||

103 Common.ExtractMainPartition || Common.OnlyKeepDebug ||

106 Common.Weaken || Common.StripUnneeded || Common.DecompressDebugSections ||

108 Common.ChangeSectionLMAValAll != 0 ||

109 Common.ChangeSectionAddress.empty() || Common.ExtractSection.empty()) {

112 "no flags are supported yet, only basic copying is allowed");

113 }

114

116}

117

120

121

122 if (Common.AddGnuDebugLink.empty() || Common.SplitDWO.empty() ||

123 Common.AllocSectionsPrefix.empty() ||

125 Common.KeepSection.empty() || Common.SectionsToRename.empty() ||

126 Common.SetSectionAlignment.empty() || Common.SetSectionFlags.empty() ||

127 Common.SetSectionType.empty() || Common.ExtractDWO ||

130 Common.StripUnneeded || Common.DecompressDebugSections ||

132 Common.ChangeSectionLMAValAll != 0 ||

133 Common.ChangeSectionAddress.empty()) {

135 "option is not supported for DXContainer");

136 }

138}

Tagged union holding either a T or a Error.

This is an optimization pass for GlobalISel generic memory operations.

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

Create formatted StringError object.

Expected< const DXContainerConfig & > getDXContainerConfig() const override

Definition ConfigManager.cpp:119

Expected< const XCOFFConfig & > getXCOFFConfig() const override

Definition ConfigManager.cpp:87

Expected< const WasmConfig & > getWasmConfig() const override

Definition ConfigManager.cpp:65

Expected< const ELFConfig & > getELFConfig() const override

Definition ConfigManager.cpp:16

Expected< const COFFConfig & > getCOFFConfig() const override

Definition ConfigManager.cpp:23

Expected< const MachOConfig & > getMachOConfig() const override

Definition ConfigManager.cpp:44

DXContainerConfig DXContainer