Lines Matching +full:static +full:- +full:config
1 //=== llvm-dwarfutil.cpp --------------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
42 static constexpr StringLiteral NAME##_init[] = VALUE; \
43 static constexpr ArrayRef<StringLiteral> NAME(NAME##_init, \
44 std::size(NAME##_init) - 1);
49 static constexpr opt::OptTable::Info InfoTable[] = {
66 static mc::RegisterMCTargetOptionsFlags MOF;
68 static Error validateAndSetOptions(opt::InputArgList &Args, Options &Options) {
73 formatv("unknown option: {0}", (*UnknownArgs.begin())->getSpelling())
99 Options.NumThreads = atoi(NumThreads->getValue());
104 StringRef S = Tombstone->getValue();
120 StringRef S = LinkerKind->getValue();
132 StringRef S = BuildAccelerator->getValue();
141 formatv("unknown build-accelerator value: '{0}'", S).str().c_str());
146 warning("--num-threads set to 1 because verbose mode is specified");
155 "cannot use --odr-deduplication without --garbage-collection");
157 if (Options.BuildSeparateDebugFile && Options.OutputFileName == "-")
160 "unable to write to stdout when --separate-debug-file specified");
165 static Error setConfigToAddNewDebugSections(objcopy::ConfigManager &Config,
178 Config.Common.AddSection.emplace_back(objcopy::NewSectionInfo(
186 static Error verifyOutput(const Options &Opts) {
187 if (Opts.OutputFileName == "-") {
199 if (BinOrErr->getBinary()->isObject()) {
200 if (ObjectFile *Obj = static_cast<ObjectFile *>(BinOrErr->getBinary())) {
204 if (!DICtx->verify(Opts.Verbose ? outs() : nulls(),
250 static Expected<uint32_t> saveSeparateDebugInfo(const Options &Opts,
252 objcopy::ConfigManager Config;
254 Config.Common.InputFilename = Opts.InputFileName;
255 Config.Common.OutputFilename = OutputFilename;
256 Config.Common.OnlyKeepDebug = true;
260 Config.Common.OutputFilename, [&](raw_ostream &OutFile) -> Error {
262 if (Error Err = objcopy::executeObjcopyOnBinary(Config, InputFile,
274 static Error saveNonDebugInfo(const Options &Opts, ObjectFile &InputFile,
276 objcopy::ConfigManager Config;
277 Config.Common.InputFilename = Opts.InputFileName;
278 Config.Common.OutputFilename = Opts.OutputFileName;
279 Config.Common.StripDebug = true;
281 Config.Common.AddGnuDebugLink = sys::path::filename(SeparateDebugFileName);
282 Config.Common.GnuDebugLinkCRC32 = GnuDebugLinkCRC32;
285 Config.Common.OutputFilename, [&](raw_ostream &OutFile) -> Error {
287 objcopy::executeObjcopyOnBinary(Config, InputFile, OutFile))
297 static Error splitDebugIntoSeparateFile(const Options &Opts,
313 static Error addSectionsFromLinkedData(objcopy::ConfigManager &Config,
322 if (Error Err = setConfigToAddNewDebugSections(Config, *MemFile))
330 if (Error Err = setConfigToAddNewDebugSections(Config, *MemFile))
338 if (Error Err = setConfigToAddNewDebugSections(Config, *MemFile))
346 if (Error Err = setConfigToAddNewDebugSections(Config, *MemFile))
355 static Expected<uint32_t>
358 objcopy::ConfigManager Config;
360 Config.Common.InputFilename = Opts.InputFileName;
361 Config.Common.OutputFilename = OutputFilename;
362 Config.Common.StripDebug = true;
363 Config.Common.OnlyKeepDebug = true;
367 addSectionsFromLinkedData(Config, InputFile, LinkedDebugInfoBits))
371 Config.Common.OutputFilename, [&](raw_ostream &OutFile) -> Error {
374 if (Error Err = objcopy::executeObjcopyOnBinary(Config, InputFile,
386 static Error saveSingleLinkedDebugInfo(const Options &Opts,
389 objcopy::ConfigManager Config;
391 Config.Common.InputFilename = Opts.InputFileName;
392 Config.Common.OutputFilename = Opts.OutputFileName;
393 Config.Common.StripDebug = true;
395 addSectionsFromLinkedData(Config, InputFile, LinkedDebugInfoBits))
399 Config.Common.OutputFilename, [&](raw_ostream &OutFile) -> Error {
400 return objcopy::executeObjcopyOnBinary(Config, InputFile, OutFile);
407 static Error saveLinkedDebugInfo(const Options &Opts, ObjectFile &InputFile,
428 static Error saveCopyOfFile(const Options &Opts, ObjectFile &InputFile) {
429 objcopy::ConfigManager Config;
431 Config.Common.InputFilename = Opts.InputFileName;
432 Config.Common.OutputFilename = Opts.OutputFileName;
435 Config.Common.OutputFilename, [&](raw_ostream &OutFile) -> Error {
436 return objcopy::executeObjcopyOnBinary(Config, InputFile, OutFile);
443 static Error applyCLOptions(const struct Options &Opts, ObjectFile &InputFile) {
483 ArrayRef<const char *> ArgsArr = ArrayRef(Argv + 1, Argc - 1);
489 "llvm-dwarfutil is a tool to copy and manipulate debug info", false);
522 if (!(*BinOrErr)->isObject())
530 BinOrErr->reset();
531 BuffOrErr->reset();
533 if (Error Err = PermsApplierOrErr->apply(Opts.OutputFileName))
537 if (Error Err = PermsApplierOrErr->apply(Opts.getSeparateDebugFileName()))