Lines Matching +full:non +full:- +full:empty
1 //===--- llvm-as.cpp - The low-level LLVM assembler -----------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 // llvm-as --help - Output information about command line switches
11 // llvm-as [options] - Read LLVM asm from stdin, write bitcode to stdout
12 // llvm-as [options] x.ll - Read LLVM asm from the x.ll file, write bitcode
15 //===----------------------------------------------------------------------===//
33 cl::OptionCategory AsCat("llvm-as Options");
37 cl::init("-"));
47 static cl::opt<bool> DisableOutput("disable-output", cl::desc("Disable output"),
50 static cl::opt<bool> EmitModuleHash("module-hash", cl::desc("Emit module hash"),
57 DisableVerify("disable-verify", cl::Hidden,
62 "preserve-bc-uselistorder",
63 cl::desc("Preserve use-list order when writing LLVM bitcode."),
66 static cl::opt<std::string> ClDataLayout("data-layout",
68 cl::value_desc("layout-string"),
75 if (OutputFilename.empty()) { in WriteOutputFile()
76 if (InputFilename == "-") { in WriteOutputFile()
77 OutputFilename = "-"; in WriteOutputFile()
93 if (Force || !CheckBitcodeOutputToConsole(Out->os())) { in WriteOutputFile()
96 // has non-zero flags. The latter is used to assemble dummy index files for in WriteOutputFile()
97 // skipping modules by distributed ThinLTO backends. Otherwise we get an empty in WriteOutputFile()
99 if (Index && (Index->begin() != Index->end() || Index->getFlags())) in WriteOutputFile()
101 if (!IndexToWrite || (M && (!M->empty() || !M->global_empty()))) in WriteOutputFile()
102 // If we have a non-empty Module, then we write the Module plus in WriteOutputFile()
103 // any non-null Index along with it as a per-module Index. in WriteOutputFile()
104 // If both are empty, this will give an empty module block, which is in WriteOutputFile()
106 WriteBitcodeToFile(*M, Out->os(), PreserveBitcodeUseListOrder, in WriteOutputFile()
109 // Otherwise, with an empty Module but non-empty Index, we write a in WriteOutputFile()
111 writeIndexToFile(*IndexToWrite, Out->os()); in WriteOutputFile()
115 Out->keep(); in WriteOutputFile()
121 cl::ParseCommandLineOptions(argc, argv, "llvm .ll -> .bc assembler\n"); in main()
126 auto SetDataLayout = [](StringRef, StringRef) -> std::optional<std::string> { in main()
127 if (ClDataLayout.empty()) in main()
146 M->setIsNewDbgInfoFormat(UseNewDbgInfoFormat && in main()
148 if (M->IsNewDbgInfoFormat) in main()
149 M->removeDebugIntrinsicDeclarations(); in main()
167 if (Index.get() && Index->begin() != Index->end()) in main()
168 Index->print(errs()); in main()