[libclc] [LIBCLC] Teach prepare-builtins how to handle text based IR (PR #66993)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 21 03:56:46 PDT 2023


================
@@ -5,30 +5,37 @@
 #include "llvm/Bitcode/ReaderWriter.h"
 #endif
 
+#include "llvm/Config/llvm-config.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/GlobalVariable.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Module.h"
+#include "llvm/IRReader/IRReader.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/ErrorOr.h"
+#include "llvm/Support/FileSystem.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/MemoryBuffer.h"
-#include "llvm/Support/FileSystem.h"
-#include "llvm/Support/raw_ostream.h"
-#include "llvm/Support/ErrorOr.h"
+#include "llvm/Support/SourceMgr.h"
 #include "llvm/Support/ToolOutputFile.h"
-#include "llvm/Config/llvm-config.h"
+#include "llvm/Support/raw_ostream.h"
 
 #include <system_error>
 
 using namespace llvm;
 
+static ExitOnError ExitOnErr;
+
 static cl::opt<std::string>
 InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
 
 static cl::opt<std::string>
 OutputFilename("o", cl::desc("Output filename"),
                cl::value_desc("filename"));
 
+static cl::opt<bool> TextualOut("S", cl::desc("Emit LLVM textual assembly"),
----------------
ldrumm wrote:

what do the other tools do here?
IIRC opt prints bitcode if bitcode is given, but textual assembly if textual IR is given. If this inferred already and this switch just an override?

https://github.com/llvm/llvm-project/pull/66993


More information about the cfe-commits mailing list