//===----------------------------------------------------------------------===//
//
// This programs is a simple example that creates an LLVM module "from scratch",
-// emitting it as a bytecode file to standard out. This is just to show how
+// emitting it as a bitcode file to standard out. This is just to show how
// LLVM projects work and to demonstrate some of the LLVM APIs.
//
//===----------------------------------------------------------------------===//
// Create the return instruction and add it to the basic block
BB->getInstList().push_back(new ReturnInst(Add));
- // Output the bytecode file to stdout
+ // Output the bitcode file to stdout
WriteBitcodeToFile(M, std::cout);
// Delete the module and all of its contents.
///
/// Classes must implement this interface so that they may be notified when an
/// abstract type is resolved. Abstract types may be resolved into more
-/// concrete types through: linking, parsing, and bytecode reading. When this
+/// concrete types through: linking, parsing, and bitcode reading. When this
/// happens, all of the users of the type must be updated to reference the new,
/// more concrete type. They are notified through the AbstractTypeUser
/// interface.
//===----------------------------------------------------------------------===//
//
// This class implements an iterator to walk through the constants referenced by
-// a method. This is used by the Bytecode & Assembly writers to build constant
+// a method. This is used by the Bitcode & Assembly writers to build constant
// pools.
//
//===----------------------------------------------------------------------===//
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_BITECODE_ARCHIVE_H
-#define LLVM_BITECODE_ARCHIVE_H
+#ifndef LLVM_BITCODE_ARCHIVE_H
+#define LLVM_BITCODE_ARCHIVE_H
#include "llvm/ADT/ilist"
#include "llvm/System/Path.h"
/// @brief Get the offset to the first "real" file member in the archive.
unsigned getFirstFileOffset() { return firstFileOffset; }
- /// This method will scan the archive for bytecode modules, interpret them
+ /// This method will scan the archive for bitcode modules, interpret them
/// and return a vector of the instantiated modules in \p Modules. If an
/// error occurs, this method will return true. If \p ErrMessage is not null
/// and an error occurs, \p *ErrMessage will be set to a string explaining
/// the error that occurred.
/// @returns true if an error occurred
- /// @brief Instantiate all the bytecode modules located in the archive
+ /// @brief Instantiate all the bitcode modules located in the archive
bool getAllModules(std::vector<Module*>& Modules, std::string* ErrMessage);
/// This accessor looks up the \p symbol in the archive's symbol table and
);
/// This method determines whether the archive is a properly formed llvm
- /// bytecode archive. It first makes sure the symbol table has been loaded
+ /// bitcode archive. It first makes sure the symbol table has been loaded
/// and has a non-zero size. If it does, then it is an archive. If not,
- /// then it tries to load all the bytecode modules of the archive. Finally,
+ /// then it tries to load all the bitcode modules of the archive. Finally,
/// it returns whether it was successfull.
- /// @returns true if the archive is a proper llvm bytecode archive
- /// @brief Determine whether the archive is a proper llvm bytecode archive.
- bool isBytecodeArchive();
+ /// @returns true if the archive is a proper llvm bitcode archive
+ /// @brief Determine whether the archive is a proper llvm bitcode archive.
+ bool isBitcodeArchive();
/// @}
/// @name Mutators
/// This method is the only way to get the archive written to disk. It
/// creates or overwrites the file specified when \p this was created
/// or opened. The arguments provide options for writing the archive. If
- /// \p CreateSymbolTable is true, the archive is scanned for bytecode files
+ /// \p CreateSymbolTable is true, the archive is scanned for bitcode files
/// and a symbol table of the externally visible function and global
/// variable names is created. If \p TruncateNames is true, the names of the
/// archive members will have their path component stripped and the file
/// @brief Frees all the members and unmaps the archive file.
void cleanUpMemory();
- /// This type is used to keep track of bytecode modules loaded from the
+ /// This type is used to keep track of bitcode modules loaded from the
/// symbol table. It maps the file offset to a pair that consists of the
/// associated ArchiveMember and the ModuleProvider.
/// @brief Module mapping type
void setLinkage(LinkageTypes LT) { Linkage = LT; }
LinkageTypes getLinkage() const { return Linkage; }
- /// hasNotBeenReadFromBytecode - If a module provider is being used to lazily
+ /// hasNotBeenReadFromBitcode - If a module provider is being used to lazily
/// stream in functions from disk, this method can be used to check to see if
/// the function has been read in yet or not. Unless you are working on the
/// JIT or something else that streams stuff in lazily, you don't need to
/// worry about this.
- bool hasNotBeenReadFromBytecode() const { return Linkage == GhostLinkage; }
+ bool hasNotBeenReadFromBitcode() const { return Linkage == GhostLinkage; }
/// Override from Constant class. No GlobalValue's are null values so this
/// always returns false.
/// In this case the Linker still retains ownership of the Module. If the
/// releaseModule() method is used, the ownership of the Module is transferred
/// to the caller and the Linker object is only suitable for destruction.
-/// The Linker can link Modules from memory, bytecode files, or bytecode
+/// The Linker can link Modules from memory, bitcode files, or bitcode
/// archives. It retains a set of search paths in which to find any libraries
/// presented to it. By default, the linker will generate error and warning
/// messages to std::cerr but this capability can be turned off with the
ItemList& NativeItems ///< Output list of native files/libs
);
- /// This function links the bytecode \p Files into the composite module.
+ /// This function links the bitcode \p Files into the composite module.
/// Note that this does not do any linking of unresolved symbols. The \p
/// Files are all completely linked into \p HeadModule regardless of
- /// unresolved symbols. This function just loads each bytecode file and
+ /// unresolved symbols. This function just loads each bitcode file and
/// calls LinkInModule on them.
/// @returns true if an error occurs, false otherwise
/// @see getLastError
const std::vector<sys::Path> & Files ///< Files to link in
);
- /// This function links a single bytecode file, \p File, into the composite
+ /// This function links a single bitcode file, \p File, into the composite
/// module. Note that this does not attempt to resolve symbols. This method
- /// just loads the bytecode file and calls LinkInModule on it. If an error
+ /// just loads the bitcode file and calls LinkInModule on it. If an error
/// occurs, the Linker's error string is set.
/// @returns true if an error occurs, false otherwise
/// @see getLastError
bool& is_native ///< Indicates if lib a native library
);
- /// This function links one bytecode archive, \p Filename, into the module.
+ /// This function links one bitcode archive, \p Filename, into the module.
/// The archive is searched to resolve outstanding symbols. Any modules in
/// the archive that resolve outstanding symbols will be linked in. The
/// library is searched repeatedly until no more modules that resolve
/// @name Implementation
/// @{
private:
- /// Read in and parse the bytecode file named by FN and return the
+ /// Read in and parse the bitcode file named by FN and return the
/// Module it contains (wrapped in an auto_ptr), or 0 if an error occurs.
std::auto_ptr<Module> LoadObject(const sys::Path& FN);
/// Determine if the ostream provided is connected to the std::cout and
/// displayed or not (to a console window). If so, generate a warning message
-/// advising against display of bytecode and return true. Otherwise just return
+/// advising against display of bitcode and return true. Otherwise just return
/// false
/// @brief Check for output written to a console
-bool CheckBytecodeOutputToConsole(
+bool CheckBitcodeOutputToConsole(
std::ostream* stream_to_check, ///< The stream to be checked
bool print_warning = true ///< Control whether warnings are printed
);
/// @brief Construct a path to the system library directory
static void GetSystemLibraryPaths(std::vector<sys::Path>& Paths);
- /// Construct a vector of sys::Path that contains the "standard" bytecode
+ /// Construct a vector of sys::Path that contains the "standard" bitcode
/// library paths suitable for linking into an llvm program. This function
/// *must* return the value of LLVM_LIB_SEARCH_PATH as well as the value
/// of LLVM_LIBDIR. It also must provide the System library paths as
/// returned by GetSystemLibraryPaths.
/// @see GetSystemLibraryPaths
- /// @brief Construct a list of directories in which bytecode could be
+ /// @brief Construct a list of directories in which bitcode could be
/// found.
- static void GetBytecodeLibraryPaths(std::vector<sys::Path>& Paths);
+ static void GetBitcodeLibraryPaths(std::vector<sys::Path>& Paths);
/// Find the path to a library using its short name. Use the system
/// dependent library paths to locate the library.
///
/// Opaque types are also kinda weird and scary and different because they have
/// to keep a list of uses of the type. When, through linking, parsing, or
-/// bytecode reading, they become resolved, they need to find and update all
+/// bitcode reading, they become resolved, they need to find and update all
/// users of the unknown type, causing them to reference a new, more concrete
/// type. Opaque types are deleted when their use list dwindles to zero users.
///
IntegerTyID, ///< 4: Arbitrary bit width integers
FunctionTyID, ///< 5: Functions
StructTyID, ///< 6: Structures
- PackedStructTyID,///< 7: Packed Structure. This is for bytecode only
+ PackedStructTyID,///< 7: Packed Structure. This is for bitcode only
ArrayTyID, ///< 8: Arrays
PointerTyID, ///< 9: Pointers
OpaqueTyID, ///< 10: Opaque: type with unknown structure
symbols.push_back(FI->getName());
}
-// Get just the externally visible defined symbols from the bytecode
-bool llvm::GetBytecodeSymbols(const sys::Path& fName,
- std::vector<std::string>& symbols,
- std::string* ErrMsg) {
+// Get just the externally visible defined symbols from the bitcode
+bool llvm::GetBitcodeSymbols(const sys::Path& fName,
+ std::vector<std::string>& symbols,
+ std::string* ErrMsg) {
std::auto_ptr<MemoryBuffer> Buffer(
MemoryBuffer::getFileOrSTDIN(&fName.toString()[0],
fName.toString().size()));
}
ModuleProvider*
-llvm::GetBytecodeSymbols(const unsigned char *BufPtr, unsigned Length,
- const std::string& ModuleID,
- std::vector<std::string>& symbols,
- std::string* ErrMsg) {
+llvm::GetBitcodeSymbols(const unsigned char *BufPtr, unsigned Length,
+ const std::string& ModuleID,
+ std::vector<std::string>& symbols,
+ std::string* ErrMsg) {
// Get the module provider
MemoryBuffer *Buffer =MemoryBuffer::getNewMemBuffer(Length, ModuleID.c_str());
memcpy((char*)Buffer->getBufferStart(), BufPtr, Length);
-//===-- lib/Bytecode/ArchiveInternals.h -------------------------*- C++ -*-===//
+//===-- lib/Archive/ArchiveInternals.h -------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
//
//===----------------------------------------------------------------------===//
-#ifndef LIB_BYTECODE_ARCHIVEINTERNALS_H
-#define LIB_BYTECODE_ARCHIVEINTERNALS_H
+#ifndef LIB_ARCHIVE_ARCHIVEINTERNALS_H
+#define LIB_ARCHIVE_ARCHIVEINTERNALS_H
#include "llvm/Bitcode/Archive.h"
#include "llvm/System/TimeValue.h"
namespace llvm {
- /// The ArchiveMemberHeader structure is used internally for bytecode
+ /// The ArchiveMemberHeader structure is used internally for bitcode
/// archives.
/// The header precedes each file member in the archive. This structure is
/// defined using character arrays for direct and correct interpretation
}
};
- // Get just the externally visible defined symbols from the bytecode
- bool GetBytecodeSymbols(const sys::Path& fName,
+ // Get just the externally visible defined symbols from the bitcode
+ bool GetBitcodeSymbols(const sys::Path& fName,
std::vector<std::string>& symbols,
std::string* ErrMsg);
- ModuleProvider* GetBytecodeSymbols(const unsigned char*Buffer,unsigned Length,
- const std::string& ModuleID,
- std::vector<std::string>& symbols,
- std::string* ErrMsg);
+ ModuleProvider* GetBitcodeSymbols(const unsigned char*Buffer,unsigned Length,
+ const std::string& ModuleID,
+ std::vector<std::string>& symbols,
+ std::string* ErrMsg);
}
#endif
//
//===----------------------------------------------------------------------===//
//
-// Builds up standard unix archive files (.a) containing LLVM bytecode.
+// Builds up standard unix archive files (.a) containing LLVM bitcode.
//
//===----------------------------------------------------------------------===//
// it will accept them. If the name starts with #1/ and the remainder is
// digits, then those digits specify the length of the name that is
// stored immediately following the header. The special name
- // __LLVM_SYM_TAB__ identifies the symbol table for LLVM bytecode.
+ // __LLVM_SYM_TAB__ identifies the symbol table for LLVM bitcode.
// Anything else is a regular, short filename that is terminated with
// a '/' and blanks.
return result.release();
}
-// Get all the bytecode modules from the archive
+// Get all the bitcode modules from the archive
bool
Archive::getAllModules(std::vector<Module*>& Modules, std::string* ErrMessage) {
if (!mbr)
return 0;
- // Now, load the bytecode module to get the ModuleProvider
+ // Now, load the bitcode module to get the ModuleProvider
std::string FullMemberName = archPath.toString() + "(" +
mbr->getPath().toString() + ")";
MemoryBuffer *Buffer =MemoryBuffer::getNewMemBuffer(mbr->getSize(),
std::string FullMemberName = archPath.toString() + "(" +
mbr->getPath().toString() + ")";
ModuleProvider* MP =
- GetBytecodeSymbols((const unsigned char*)At, mbr->getSize(),
- FullMemberName, symbols, error);
+ GetBitcodeSymbols((const unsigned char*)At, mbr->getSize(),
+ FullMemberName, symbols, error);
if (MP) {
// Insert the module's symbols into the symbol table
modules.insert(std::make_pair(offset, std::make_pair(MP, mbr)));
} else {
if (error)
- *error = "Can't parse bytecode member: " +
+ *error = "Can't parse bitcode member: " +
mbr->getPath().toString() + ": " + *error;
delete mbr;
return false;
return true;
}
-bool Archive::isBytecodeArchive() {
+bool Archive::isBitcodeArchive() {
// Make sure the symTab has been loaded. In most cases this should have been
// done when the archive was constructed, but still, this is just in case.
if (!symTab.size())
// if it has a size
if (symTab.size()) return true;
- //We still can't be sure it isn't a bytecode archive
+ // We still can't be sure it isn't a bitcode archive
if (!loadArchive(0))
return false;
std::vector<Module *> Modules;
std::string ErrorMessage;
- // Scan the archive, trying to load a bytecode member. We only load one to
+ // Scan the archive, trying to load a bitcode member. We only load one to
// see if this works.
for (iterator I = begin(), E = end(); I != E; ++I) {
if (!I->isBytecode() && !I->isCompressedBytecode())
Module *M = ParseBitcodeFile(Buffer);
delete Buffer;
if (!M)
- return false; // Couldn't parse bytecode, not a bytecode archive.
+ return false; // Couldn't parse bitcode, not a bitcode archive.
delete M;
return true;
}
//
//===----------------------------------------------------------------------===//
//
-// Builds up an LLVM archive file (.a) containing LLVM bytecode.
+// Builds up an LLVM archive file (.a) containing LLVM bitcode.
//
//===----------------------------------------------------------------------===//
}
// Now that we have the data in memory, update the
- // symbol table if its a bytecode file.
+ // symbol table if its a bitcode file.
if (CreateSymbolTable &&
(member.isBytecode() || member.isCompressedBytecode())) {
std::vector<std::string> symbols;
member.getPath().toString()
+ ")";
ModuleProvider* MP =
- GetBytecodeSymbols((const unsigned char*)data,fSize,
- FullMemberName, symbols, ErrMsg);
+ GetBitcodeSymbols((const unsigned char*)data,fSize,
+ FullMemberName, symbols, ErrMsg);
- // If the bytecode parsed successfully
+ // If the bitcode parsed successfully
if ( MP ) {
for (std::vector<std::string>::iterator SI = symbols.begin(),
SE = symbols.end(); SI != SE; ++SI) {
delete mFile;
}
if (ErrMsg)
- *ErrMsg = "Can't parse bytecode member: " + member.getPath().toString()
+ *ErrMsg = "Can't parse bitcode member: " + member.getPath().toString()
+ ": " + *ErrMsg;
return true;
}
bool BitcodeReader::materializeFunction(Function *F, std::string *ErrInfo) {
// If it already is material, ignore the request.
- if (!F->hasNotBeenReadFromBytecode()) return false;
+ if (!F->hasNotBeenReadFromBitcode()) return false;
DenseMap<Function*, std::pair<uint64_t, unsigned> >::iterator DFII =
DeferredFunctionInfo.find(F);
void BitcodeReader::dematerializeFunction(Function *F) {
// If this function isn't materialized, or if it is a proto, this is a noop.
- if (F->hasNotBeenReadFromBytecode() || F->isDeclaration())
+ if (F->hasNotBeenReadFromBitcode() || F->isDeclaration())
return;
assert(DeferredFunctionInfo.count(F) && "No info to read function later?");
DeferredFunctionInfo.begin(), E = DeferredFunctionInfo.end(); I != E;
++I) {
Function *F = I->first;
- if (F->hasNotBeenReadFromBytecode() &&
+ if (F->hasNotBeenReadFromBitcode() &&
materializeFunction(F, ErrInfo))
return 0;
}
private:
// The buffer we accumulate the file header into. Note that this should be
- // changed into something much more efficient later (and the bytecode writer
+ // changed into something much more efficient later (and the bitcode writer
// as well!).
DataBuffer FileHeader;
//===----------------------------------------------------------------------===//
//
// This tool implements a just-in-time compiler for LLVM, allowing direct
-// execution of LLVM bytecode in an efficient manner.
+// execution of LLVM bitcode in an efficient manner.
//
//===----------------------------------------------------------------------===//
return Addr; // Check if function already code gen'd
// Make sure we read in the function if it exists in this Module.
- if (F->hasNotBeenReadFromBytecode()) {
+ if (F->hasNotBeenReadFromBitcode()) {
// Determine the module provider this function is provided by.
Module *M = F->getParent();
ModuleProvider *MP = 0;
std::string ErrorMsg;
if (MP->materializeFunction(F, &ErrorMsg)) {
cerr << "Error reading function '" << F->getName()
- << "' from bytecode file: " << ErrorMsg << "\n";
+ << "' from bitcode file: " << ErrorMsg << "\n";
abort();
}
}
// Call the lazy resolver function unless we already KNOW it is an external
// function, in which case we just skip the lazy resolution step.
void *Actual = (void*)(intptr_t)LazyResolverFn;
- if (F->isDeclaration() && !F->hasNotBeenReadFromBytecode())
+ if (F->isDeclaration() && !F->hasNotBeenReadFromBitcode())
Actual = TheJIT->getPointerToFunction(F);
// Otherwise, codegen a new stub. For now, the stub will call the lazy
void *ResultPtr = TheJIT->getPointerToGlobalIfAvailable(F);
if (ResultPtr) return ResultPtr;
- if (F->isDeclaration() && !F->hasNotBeenReadFromBytecode()) {
+ if (F->isDeclaration() && !F->hasNotBeenReadFromBitcode()) {
// If this is an external function pointer, we can force the JIT to
// 'compile' it, which really just adds it to the map.
if (DoesntNeedStub)
if (!arch)
return error("Cannot read archive '" + Filename.toString() +
"': " + ErrMsg);
- if (!arch->isBytecodeArchive()) {
+ if (!arch->isBitcodeArchive()) {
is_native = true;
return false;
}
//
//===----------------------------------------------------------------------===//
//
-// This file contains routines to handle linking together LLVM bytecode files,
+// This file contains routines to handle linking together LLVM bitcode files,
// and to handle annoying things like static libraries.
//
//===----------------------------------------------------------------------===//
// LinkItems - This function is the main entry point into linking. It takes a
// list of LinkItem which indicates the order the files should be linked and
// how each file should be treated (plain file or with library search). The
-// function only links bytecode and produces a result list of items that are
+// function only links bitcode and produces a result list of items that are
// native objects.
bool
Linker::LinkInItems(const ItemList& Items, ItemList& NativeItems) {
}
/// LinkLibraries - takes the specified library files and links them into the
-/// main bytecode object file.
+/// main bitcode object file.
///
/// Inputs:
/// Libraries - The list of libraries to link into the module.
return false;
}
-/// LinkInFile - opens a bytecode file and links in all objects which
+/// LinkInFile - opens a bitcode file and links in all objects which
/// provide symbols that are currently undefined.
///
/// Inputs:
-/// File - The pathname of the bytecode file.
+/// File - The pathname of the bitcode file.
///
/// Outputs:
/// ErrorMessage - A C++ string detailing what error occurred, if any.
case sys::Bitcode_FileType:
case sys::Bytecode_FileType:
case sys::CompressedBytecode_FileType: {
- verbose("Linking bytecode file '" + File.toString() + "'");
+ verbose("Linking bitcode file '" + File.toString() + "'");
std::auto_ptr<Module> M(LoadObject(File));
if (M.get() == 0)
return error("Cannot load file '" + File.toString() + "'" + Error);
/// or relative pathname, or as a file somewhere in LLVM_LIB_SEARCH_PATH.
///
/// Inputs:
-/// Files - A vector of sys::Path indicating the LLVM bytecode filenames
+/// Files - A vector of sys::Path indicating the LLVM bitcode filenames
/// to be linked. The names can refer to a mixture of pure LLVM
-/// bytecode files and archive (ar) formatted files.
+/// bitcode files and archive (ar) formatted files.
///
/// Return value:
/// FALSE - No errors.
void
Linker::addSystemPaths() {
- sys::Path::GetBytecodeLibraryPaths(LibPaths);
+ sys::Path::GetBitcodeLibraryPaths(LibPaths);
LibPaths.insert(LibPaths.begin(),sys::Path("./"));
}
return result;
}
-// LoadObject - Read in and parse the bytecode file named by FN and return the
+// LoadObject - Read in and parse the bitcode file named by FN and return the
// module it contains (wrapped in an auto_ptr), or auto_ptr<Module>() and set
// Error if an error occurs.
std::auto_ptr<Module>
if (Result)
return std::auto_ptr<Module>(Result);
- Error = "Bytecode file '" + FN.toString() + "' could not be loaded";
+ Error = "Bitcode file '" + FN.toString() + "' could not be loaded";
if (ParseErrorMessage.size())
Error += ": " + ParseErrorMessage;
return std::auto_ptr<Module>();
#include <ostream>
using namespace llvm;
-bool llvm::CheckBytecodeOutputToConsole(std::ostream* stream_to_check,
- bool print_warning) {
+bool llvm::CheckBitcodeOutputToConsole(std::ostream* stream_to_check,
+ bool print_warning) {
if (stream_to_check == cout.stream() &&
sys::Process::StandardOutIsDisplayed()) {
if (print_warning) {
- cerr << "WARNING: You're attempting to print out a bytecode file.\n"
+ cerr << "WARNING: You're attempting to print out a bitcode file.\n"
<< "This is inadvisable as it may cause display problems. If\n"
- << "you REALLY want to taste LLVM bytecode first-hand, you\n"
+ << "you REALLY want to taste LLVM bitcode first-hand, you\n"
<< "can force output with the `-f' option.\n\n";
}
return true;
}
void
-Path::GetBytecodeLibraryPaths(std::vector<sys::Path>& Paths) {
+Path::GetBitcodeLibraryPaths(std::vector<sys::Path>& Paths) {
char * env_var = getenv("LLVM_LIB_SEARCH_PATH");
if (env_var != 0) {
getPathList(env_var,Paths);
static bool GVIsIndirectSymbol(GlobalValue *GV, Reloc::Model RelocM) {
return RelocM != Reloc::Static &&
(GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() ||
- (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode()));
+ (GV->isDeclaration() && !GV->hasNotBeenReadFromBitcode()));
}
SDOperand ARMTargetLowering::LowerGlobalAddressDarwin(SDOperand Op,
//===----------------------------------------------------------------------===//
//
// This file defines the PowerPC 32-bit CodeEmitter and associated machinery to
-// JIT-compile bytecode to native PowerPC.
+// JIT-compile bitcode to native PowerPC.
//
//===----------------------------------------------------------------------===//
return false;
return GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() ||
- (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode());
+ (GV->isDeclaration() && !GV->hasNotBeenReadFromBitcode());
}
if (isTargetDarwin()) {
return (!isDirectCall &&
(GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() ||
- (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode())));
+ (GV->isDeclaration() && !GV->hasNotBeenReadFromBitcode())));
} else if (TM.getRelocationModel() == Reloc::PIC_ && isPICStyleGOT()) {
// Extra load is needed for all non-statics.
return (!isDirectCall &&
bool FunctionPassManager::run(Function &F) {
std::string errstr;
if (MP->materializeFunction(&F, &errstr)) {
- cerr << "Error reading bytecode file: " << errstr << "\n";
+ cerr << "Error reading bitcode file: " << errstr << "\n";
abort();
}
return FPM->run(F);
//
// This is the llc code generator driver. It provides a convenient
// command-line interface for generating native assembly-language code
-// or C code, given LLVM bytecode.
+// or C code, given LLVM bitcode.
//
//===----------------------------------------------------------------------===//
// and back-end code generation options are specified with the target machine.
//
static cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input bytecode>"), cl::init("-"));
+InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
static cl::opt<std::string>
OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"));
if (Buffer.get())
M.reset(ParseBitcodeFile(Buffer.get(), &ErrorMessage));
if (M.get() == 0) {
- std::cerr << argv[0] << ": bytecode didn't read correctly.\n";
+ std::cerr << argv[0] << ": bitcode didn't read correctly.\n";
std::cerr << "Reason: " << ErrorMessage << "\n";
return 1;
}
namespace {
cl::opt<std::string>
- InputFile(cl::desc("<input bytecode>"), cl::Positional, cl::init("-"));
+ InputFile(cl::desc("<input bitcode>"), cl::Positional, cl::init("-"));
cl::list<std::string>
InputArgv(cl::ConsumeAfter, cl::desc("<program arguments>..."));
if (DisableCoreFiles)
sys::Process::PreventCoreFiles();
- // Load the bytecode...
+ // Load the bitcode...
std::string ErrorMsg;
ModuleProvider *MP = 0;
if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(InputFile,&ErrorMsg)){
//===----------------------------------------------------------------------===//
//
// Builds up (relatively) standard unix archive files (.a) containing LLVM
-// bytecode or other files.
+// bitcode or other files.
//
//===----------------------------------------------------------------------===//
" [b] - put file(s) before [relpos] (same as [i])\n"
" [f] - truncate inserted file names\n"
" [i] - put file(s) before [relpos] (same as [b])\n"
- " [k] - always print bytecode files (default is to skip them)\n"
+ " [k] - always print bitcode files (default is to skip them)\n"
" [N] - use instance [count] of name\n"
" [o] - preserve original dates\n"
" [P] - use full path names when matching\n"
bool Create = false; ///< 'c' modifier
bool TruncateNames = false; ///< 'f' modifier
bool InsertBefore = false; ///< 'i' modifier
-bool DontSkipBytecode = false; ///< 'k' modifier
+bool DontSkipBitcode = false; ///< 'k' modifier
bool UseCount = false; ///< 'N' modifier
bool OriginalDates = false; ///< 'o' modifier
bool FullPath = false; ///< 'P' modifier
case 'x': ++NumOperations; Operation = Extract; break;
case 'c': Create = true; break;
case 'f': TruncateNames = true; break;
- case 'k': DontSkipBytecode = true; break;
+ case 'k': DontSkipBitcode = true; break;
case 'l': /* accepted but unused */ break;
case 'o': OriginalDates = true; break;
case 'P': FullPath = true; break;
// doPrint - Implements the 'p' operation. This function traverses the archive
// looking for members that match the path list. It is careful to uncompress
-// things that should be and to skip bytecode files unless the 'k' modifier was
+// things that should be and to skip bitcode files unless the 'k' modifier was
// given.
bool doPrint(std::string* ErrMsg) {
if (buildPaths(false, ErrMsg))
// Skip things that don't make sense to print
if (I->isLLVMSymbolTable() || I->isSVR4SymbolTable() ||
- I->isBSD4SymbolTable() || (!DontSkipBytecode &&
+ I->isBSD4SymbolTable() || (!DontSkipBitcode &&
(I->isBytecode() || I->isCompressedBytecode())))
continue;
// like --help and --version.
cl::ParseCommandLineOptions(argc, argv,
" LLVM Archiver (llvm-ar)\n\n"
- " This program archives bytecode files into single libraries\n"
+ " This program archives bitcode files into single libraries\n"
);
// Print a stack trace if we signal out.
return 1;
}
- if (Force || !CheckBytecodeOutputToConsole(Out,true))
+ if (Force || !CheckBitcodeOutputToConsole(Out,true))
WriteBitcodeToFile(M.get(), *Out);
} catch (const std::string& msg) {
cerr << argv[0] << ": " << msg << "\n";
/// file command - If the user specifies an option, search the PATH for the
-/// specified program/bytecode file and load it. If the user does not specify
+/// specified program/bitcode file and load it. If the user does not specify
/// an option, unload the current program.
void CLIDebugger::fileCommand(std::string &Options) {
std::string Prog = getToken(Options);
//===----------------------------------------------------------------------===//
//
// This utility may be invoked in the following manner:
-// llvm-dis [options] - Read LLVM bytecode from stdin, write asm to stdout
-// llvm-dis [options] x.bc - Read LLVM bytecode from the x.bc file, write asm
+// llvm-dis [options] - Read LLVM bitcode from stdin, write asm to stdout
+// llvm-dis [options] x.bc - Read LLVM bitcode from the x.bc file, write asm
// to the x.ll file.
// Options:
// --help - Output information about command line switches
using namespace llvm;
static cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input bytecode>"), cl::init("-"));
+InputFilename(cl::Positional, cl::desc("<input bitcode>"), cl::init("-"));
static cl::opt<std::string>
OutputFilename("o", cl::desc("Override output filename"),
if (ErrorMessage.size())
cerr << ErrorMessage << "\n";
else
- cerr << "bytecode didn't read correctly.\n";
+ cerr << "bitcode didn't read correctly.\n";
return 1;
}
// InputFilename - The filename to read from.
static cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input bytecode file>"),
+InputFilename(cl::Positional, cl::desc("<input bitcode file>"),
cl::init("-"), cl::value_desc("filename"));
static cl::opt<std::string>
delete Buffer;
if (M.get() == 0) {
- cerr << argv[0] << ": bytecode didn't read correctly.\n";
+ cerr << argv[0] << ": bitcode didn't read correctly.\n";
return 1;
}
// system 'ld' conventions. As such, the default output file is ./a.out.
// Additionally, this program outputs a shell script that is used to invoke LLI
// to execute the program. In this manner, the generated executable (a.out for
-// example), is directly executable, whereas the bytecode file actually lives in
+// example), is directly executable, whereas the bitcode file actually lives in
// the a.out.bc file generated by this program. Also, Force is on by default.
//
// Note that if someone (or a script) deletes the executable program generated,
// Input/Output Options
static cl::list<std::string> InputFilenames(cl::Positional, cl::OneOrMore,
- cl::desc("<input bytecode files>"));
+ cl::desc("<input bitcode files>"));
static cl::opt<std::string> OutputFilename("o", cl::init("a.out"),
cl::desc("Override output filename"),
return;
}
-/// GenerateBytecode - generates a bytecode file from the module provided
-void GenerateBytecode(Module* M, const std::string& FileName) {
+/// GenerateBitcode - generates a bitcode file from the module provided
+void GenerateBitcode(Module* M, const std::string& FileName) {
if (Verbose)
- cout << "Generating Bytecode To " << FileName << '\n';
+ cout << "Generating Bitcode To " << FileName << '\n';
// Create the output file.
std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
if (!Out.good())
PrintAndExit("error opening '" + FileName + "' for writing!");
- // Ensure that the bytecode file gets removed from the disk if we get a
+ // Ensure that the bitcode file gets removed from the disk if we get a
// terminating signal.
sys::RemoveFileOnSignal(sys::Path(FileName));
// Write it out
WriteBitcodeToFile(M, Out);
- // Close the bytecode file.
+ // Close the bitcode file.
Out.close();
}
/// GenerateAssembly - generates a native assembly language source file from the
-/// specified bytecode file.
+/// specified bitcode file.
///
/// Inputs:
-/// InputFilename - The name of the input bytecode file.
+/// InputFilename - The name of the input bitcode file.
/// OutputFilename - The name of the file to generate.
/// llc - The pathname to use for LLC.
/// envp - The environment to use when running LLC.
const std::string &InputFilename,
const sys::Path &llc,
std::string &ErrMsg ) {
- // Run LLC to convert the bytecode file into assembly code.
+ // Run LLC to convert the bitcode file into assembly code.
std::vector<const char*> args;
args.push_back(llc.c_str());
args.push_back("-f");
return sys::Program::ExecuteAndWait(llc, &args[0], 0, 0, 0, 0, &ErrMsg);
}
-/// GenerateCFile - generates a C source file from the specified bytecode file.
+/// GenerateCFile - generates a C source file from the specified bitcode file.
static int GenerateCFile(const std::string &OutputFile,
const std::string &InputFile,
const sys::Path &llc,
std::string& ErrMsg) {
- // Run LLC to convert the bytecode file into C.
+ // Run LLC to convert the bitcode file into C.
std::vector<const char*> args;
args.push_back(llc.c_str());
args.push_back("-march=c");
}
/// GenerateNative - generates a native object file from the
-/// specified bytecode file.
+/// specified bitcode file.
///
/// Inputs:
-/// InputFilename - The name of the input bytecode file.
+/// InputFilename - The name of the input bitcode file.
/// OutputFilename - The name of the file to generate.
/// NativeLinkItems - The native libraries, files, code with which to link
/// LibPaths - The list of directories in which to find libraries.
}
/// EmitShellScript - Output the wrapper file that invokes the JIT on the LLVM
-/// bytecode file for the program.
+/// bitcode file for the program.
static void EmitShellScript(char **argv) {
if (Verbose)
cout << "Emitting Shell Script\n";
// Construct a Linker (now that Verbose is set)
Linker TheLinker(progname, OutputFilename, Verbose);
- // Keep track of the native link items (versus the bytecode items)
+ // Keep track of the native link items (versus the bitcode items)
Linker::ItemList NativeLinkItems;
// Add library paths to the linker
// Optimize the module
Optimize(Composite.get());
- // Generate the bytecode for the optimized module.
- std::string RealBytecodeOutput = OutputFilename;
- if (!LinkAsLibrary) RealBytecodeOutput += ".bc";
- GenerateBytecode(Composite.get(), RealBytecodeOutput);
+ // Generate the bitcode for the optimized module.
+ std::string RealBitcodeOutput = OutputFilename;
+ if (!LinkAsLibrary) RealBitcodeOutput += ".bc";
+ GenerateBitcode(Composite.get(), RealBitcodeOutput);
// If we are not linking a library, generate either a native executable
// or a JIT shell script, depending upon what the user wants.
const char* args[4];
args[0] = I->c_str();
- args[1] = RealBytecodeOutput.c_str();
+ args[1] = RealBitcodeOutput.c_str();
args[2] = tmp_output.c_str();
args[3] = 0;
if (0 == sys::Program::ExecuteAndWait(prog, args, 0,0,0,0, &ErrMsg)) {
- if (tmp_output.isBytecodeFile() || tmp_output.isBitcodeFile()) {
- sys::Path target(RealBytecodeOutput);
+ if (tmp_output.isBitcodeFile() || tmp_output.isBitcodeFile()) {
+ sys::Path target(RealBitcodeOutput);
target.eraseFromDisk();
if (tmp_output.renamePathOnDisk(target, &ErrMsg))
PrintAndExit(ErrMsg, 2);
} else
- PrintAndExit("Post-link optimization output is not bytecode");
+ PrintAndExit("Post-link optimization output is not bitcode");
} else {
PrintAndExit(ErrMsg);
}
}
// If the user wants to generate a native executable, compile it from the
- // bytecode file.
+ // bitcode file.
//
- // Otherwise, create a script that will run the bytecode through the JIT.
+ // Otherwise, create a script that will run the bitcode through the JIT.
if (Native) {
// Name of the Assembly Language output file
sys::Path AssemblyFile ( OutputFilename);
if (gcc.isEmpty())
PrintAndExit("Failed to find gcc");
- // Generate an assembly language file for the bytecode.
+ // Generate an assembly language file for the bitcode.
std::string ErrMsg;
- if (0 != GenerateAssembly(AssemblyFile.toString(), RealBytecodeOutput,
+ if (0 != GenerateAssembly(AssemblyFile.toString(), RealBitcodeOutput,
llc, ErrMsg))
PrintAndExit(ErrMsg);
if (gcc.isEmpty())
PrintAndExit("Failed to find gcc");
- // Generate an assembly language file for the bytecode.
+ // Generate an assembly language file for the bitcode.
std::string ErrMsg;
if (0 != GenerateCFile(
- CFile.toString(), RealBytecodeOutput, llc, ErrMsg))
+ CFile.toString(), RealBitcodeOutput, llc, ErrMsg))
PrintAndExit(ErrMsg);
if (0 != GenerateNative(OutputFilename, CFile.toString(),
if (sys::Path(OutputFilename).makeExecutableOnDisk(&ErrMsg))
PrintAndExit(ErrMsg);
- // Make the bytecode file readable and directly executable in LLEE as well
- if (sys::Path(RealBytecodeOutput).makeExecutableOnDisk(&ErrMsg))
+ // Make the bitcode file readable and directly executable in LLEE as well
+ if (sys::Path(RealBitcodeOutput).makeExecutableOnDisk(&ErrMsg))
PrintAndExit(ErrMsg);
- if (sys::Path(RealBytecodeOutput).makeReadableOnDisk(&ErrMsg))
+ if (sys::Path(RealBitcodeOutput).makeReadableOnDisk(&ErrMsg))
PrintAndExit(ErrMsg);
}
} catch (const std::string& msg) {
static cl::list<std::string>
InputFilenames(cl::Positional, cl::OneOrMore,
- cl::desc("<input bytecode files>"));
+ cl::desc("<input bitcode files>"));
static cl::opt<std::string>
OutputFilename("o", cl::desc("Override output filename"), cl::init("-"),
static cl::opt<bool>
DumpAsm("d", cl::desc("Print assembly as linked"), cl::Hidden);
-// LoadFile - Read the specified bytecode file in and return it. This routine
+// LoadFile - Read the specified bitcode file in and return it. This routine
// searches the link path for the specified file to try to find it...
//
static inline std::auto_ptr<Module> LoadFile(const std::string &FN) {
if (Result) return std::auto_ptr<Module>(Result); // Load successful!
if (Verbose) {
- cerr << "Error opening bytecode file: '" << Filename.c_str() << "'";
+ cerr << "Error opening bitcode file: '" << Filename.c_str() << "'";
if (ErrorMessage.size()) cerr << ": " << ErrorMessage;
cerr << "\n";
}
} else {
- cerr << "Bytecode file: '" << Filename.c_str() << "' does not exist.\n";
+ cerr << "Bitcode file: '" << Filename.c_str() << "' does not exist.\n";
}
return std::auto_ptr<Module>();
return 1;
}
- if (Verbose) cerr << "Writing bytecode...\n";
+ if (Verbose) cerr << "Writing bitcode...\n";
WriteBitcodeToFile(Composite.get(), *Out);
if (Out != &std::cout) delete Out;
//===----------------------------------------------------------------------===//
//
// This program is a utility that works like traditional Unix "nm",
-// that is, it prints out the names of symbols in a bytecode file,
+// that is, it prints out the names of symbols in a bitcode file,
// along with some information about each symbol.
//
// This "nm" does not print symbols' addresses. It supports many of
cl::aliasopt(OutputFormat));
cl::list<std::string>
- InputFilenames(cl::Positional, cl::desc("<input bytecode files>"),
+ InputFilenames(cl::Positional, cl::desc("<input bitcode files>"),
cl::ZeroOrMore);
cl::opt<bool> UndefinedOnly("undefined-only",
namespace {
cl::opt<std::string>
- BytecodeFile(cl::Positional, cl::desc("<program bytecode file>"),
- cl::Required);
+ BitcodeFile(cl::Positional, cl::desc("<program bitcode file>"),
+ cl::Required);
cl::opt<std::string>
ProfileDataFile(cl::Positional, cl::desc("<llvmprof.out file>"),
cl::ParseCommandLineOptions(argc, argv, " llvm profile dump decoder\n");
sys::PrintStackTraceOnErrorSignal();
- // Read in the bytecode file...
+ // Read in the bitcode file...
std::string ErrorMessage;
Module *M = 0;
- if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(BytecodeFile,
+ if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(BitcodeFile,
&ErrorMessage)) {
M = ParseBitcodeFile(Buffer, &ErrorMessage);
delete Buffer;
}
if (M == 0) {
- std::cerr << argv[0] << ": " << BytecodeFile << ": "
+ std::cerr << argv[0] << ": " << BitcodeFile << ": "
<< ErrorMessage << "\n";
return 1;
}
// like --help and --version.
cl::ParseCommandLineOptions(argc, argv,
" LLVM Archive Index Generator (llvm-ranlib)\n\n"
- " This program adds or updates an index of bytecode symbols\n"
+ " This program adds or updates an index of bitcode symbols\n"
" to an LLVM archive file."
);
using namespace llvm;
static cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input LLVM bytecode file>"),
+InputFilename(cl::Positional, cl::desc("<input LLVM bitcode file>"),
cl::init("-"));
static cl::opt<std::string>
if (ErrorMessage.size())
std::cerr << ErrorMessage << "\n";
else
- std::cerr << "bytecode didn't read correctly.\n";
+ std::cerr << "bitcode didn't read correctly.\n";
return 1;
}
DumpAction(&cd->Linker);
}
-static bool GetBytecodeDependentLibraries(const std::string &fname,
- Module::LibraryListType& deplibs,
- std::string* ErrMsg) {
+static bool GetBitcodeDependentLibraries(const std::string &fname,
+ Module::LibraryListType& deplibs,
+ std::string* ErrMsg) {
ModuleProvider *MP = 0;
if (MemoryBuffer *Buffer = MemoryBuffer::getFileOrSTDIN(fname)) {
MP = getBitcodeModuleProvider(Buffer);
}
/// This method processes a linkage item. The item could be a
- /// Bytecode file needing translation to native code and that is
- /// dependent on other bytecode libraries, or a native code
+ /// Bitcode file needing translation to native code and that is
+ /// dependent on other bitcode libraries, or a native code
/// library that should just be linked into the program.
bool ProcessLinkageItem(const llvm::sys::Path& link_item,
SetVector<sys::Path>& set,
// If we got here fullpath is the path to the file, and its readable.
set.insert(fullpath);
- // If its an LLVM bytecode file ...
- if (fullpath.isBytecodeFile()) {
+ // If its an LLVM bitcode file ...
+ if (fullpath.isBitcodeFile()) {
// Process the dependent libraries recursively
Module::LibraryListType modlibs;
- if (GetBytecodeDependentLibraries(fullpath.toString(),modlibs, &err)) {
+ if (GetBitcodeDependentLibraries(fullpath.toString(),modlibs, &err)) {
// Traverse the dependent libraries list
Module::lib_iterator LI = modlibs.begin();
Module::lib_iterator LE = modlibs.end();
// Get the suffix of the file name
const std::string& ftype = I->second;
- // If its a library, bytecode file, or object file, save
+ // If its a library, bitcode file, or object file, save
// it for linking below and short circuit the
// pre-processing/translation/assembly phases
if (ftype.empty() || ftype == "o" || ftype == "bc" || ftype=="a") {
// ll -> bc Helper
if (action.isSet(OUTPUT_IS_ASM_FLAG)) {
/// The output of the translator is an LLVM Assembly program
- /// We need to translate it to bytecode
+ /// We need to translate it to bitcode
Action* action = new Action();
action->program.set("llvm-as");
action->args.push_back(InFile.toString());
// ll -> bc Helper
if (action.isSet(OUTPUT_IS_ASM_FLAG)) {
/// The output of the optimizer is an LLVM Assembly program
- /// We need to translate it to bytecode with llvm-as
+ /// We need to translate it to bitcode with llvm-as
Action* action = new Action();
action->program.set("llvm-as");
action->args.push_back(InFile.toString());
/// @brief The phases of processing that llvmc understands
enum Phases {
PREPROCESSING, ///< Source language combining, filtering, substitution
- TRANSLATION, ///< Translate source -> LLVM bytecode/assembly
+ TRANSLATION, ///< Translate source -> LLVM bitcode/assembly
OPTIMIZATION, ///< Optimize translation result
ASSEMBLY, ///< Convert program to executable
- LINKING, ///< Link bytecode and native code
+ LINKING, ///< Link bitcode and native code
NUM_PHASES ///< Always last!
};
TIME_ACTIONS_FLAG = 0x0010, ///< Time the actions as they execute
SHOW_STATS_FLAG = 0x0020, ///< Show pass statistics
EMIT_NATIVE_FLAG = 0x0040, ///< Emit native code instead of bc
- EMIT_RAW_FLAG = 0x0080, ///< Emit raw, unoptimized bytecode
+ EMIT_RAW_FLAG = 0x0080, ///< Emit raw, unoptimized bitcode
KEEP_TEMPS_FLAG = 0x0100, ///< Don't delete temporary files
STRIP_OUTPUT_FLAG = 0x0200, ///< Strip symbols from linked output
DRIVER_FLAGS_MASK = 0x03FF ///< Union of the above flags
BINDIR_SUBST, ///< The substitution item %bindir%
ASSEMBLY, ///< The value "assembly" (and variants)
ASSEMBLER, ///< The name "assembler" (and variants)
- BYTECODE, ///< The value "bytecode" (and variants)
+ BITCODE, ///< The value "bitcode" (and variants)
COMMAND, ///< The name "command" (and variants)
DEFS_SUBST, ///< The substitution item %defs%
EQUALS, ///< The equals sign, =
COMMAND command|Command|COMMAND
LANG lang|Lang|LANG
LIBS libs|Libs|LIBS
-LINKER linker|Linker|LINKER
+LINKER linker|Linker|LINKER
NAME name|Name|NAME
OPT1 opt1|Opt1|OPT1
OPT2 opt2|Opt2|OPT2
True true|True|TRUE|on|On|ON|yes|Yes|YES
False false|False|FALSE|off|Off|OFF|no|No|NO
-Bytecode bc|BC|bytecode|Bytecode|BYTECODE
+Bitcode bc|BC|bitcode|Bitcode|BITCODE
Assembly asm|ASM|assembly|Assembly|ASSEMBLY
BadSubst \%[a-zA-Z]*\%
%WOpts% { return handleSubstitution(WOPTS_SUBST); }
{Assembly} { return handleValueContext(ASSEMBLY); }
-{Bytecode} { return handleValueContext(BYTECODE); }
+{Bitcode} { return handleValueContext(BITCODE); }
{True} { return handleValueContext(TRUETOK); }
{False} { return handleValueContext(FALSETOK); }
case ASSEMBLY:
str += "assembly";
break;
- case BYTECODE:
- str += "bytecode";
+ case BITCODE:
+ str += "bitcode";
break;
case TRUETOK:
str += "true";
case ASSEMBLY:
anOption += "assembly";
break;
- case BYTECODE:
- anOption += "bytecode";
+ case BITCODE:
+ anOption += "bitcode";
break;
case TRUETOK:
anOption += "true";
next();
if (token == ASSEMBLY) {
return true;
- } else if (token == BYTECODE) {
+ } else if (token == BITCODE) {
return false;
} else {
error("Expecting output type value");
cl::desc("Specify a target machine"), cl::value_desc("machine"));
static cl::opt<bool> Native("native", cl::init(false),
- cl::desc("Generative native code instead of bytecode"));
+ cl::desc("Generative native code instead of bitcode"));
static cl::opt<bool> DebugOutput("g", cl::init(false),
cl::desc("Generate objects that include debug symbols"));
delete (llvm::LTO*)lto;
}
-/// Read an LLVM bytecode file using LTO::readLLVMObjectFile.
+/// Read an LLVM bitcode file using LTO::readLLVMObjectFile.
extern "C"
llvm_lto_status
llvm_read_object_file(llvm_lto_t lto, const char *input_filename) {
delete m;
}
-/// InputFilename is a LLVM bytecode file. If Module with InputFilename is
+/// InputFilename is a LLVM bitcode file. If Module with InputFilename is
/// available then return it. Otherwise parseInputFilename.
Module *
LTO::getModule(const std::string &InputFilename)
return m;
}
-/// InputFilename is a LLVM bytecode file. Reade this bytecode file and
+/// InputFilename is a LLVM bitcode file. Reade this bitcode file and
/// set corresponding target triplet string.
void
LTO::getTargetTriple(const std::string &InputFilename,
targetTriple = m->getTargetTriple();
}
-/// InputFilename is a LLVM bytecode file. Read it using bytecode reader.
+/// InputFilename is a LLVM bitcode file. Read it using bitcode reader.
/// Collect global functions and symbol names in symbols vector.
/// Collect external references in references vector.
/// Return LTO_READ_SUCCESS if there is no error.
// Other command line options...
//
static cl::opt<std::string>
-InputFilename(cl::Positional, cl::desc("<input bytecode file>"),
+InputFilename(cl::Positional, cl::desc("<input bitcode file>"),
cl::init("-"), cl::value_desc("filename"));
static cl::opt<std::string>
static cl::opt<bool>
NoOutput("disable-output",
- cl::desc("Do not write result bytecode file"), cl::Hidden);
+ cl::desc("Do not write result bitcode file"), cl::Hidden);
static cl::opt<bool>
NoVerify("disable-verify", cl::desc("Do not verify result module"), cl::Hidden);
if (ErrorMessage.size())
cerr << ErrorMessage << "\n";
else
- cerr << "bytecode didn't read correctly.\n";
+ cerr << "bitcode didn't read correctly.\n";
return 1;
}
// If the output is set to be emitted to standard out, and standard out is a
// console, print out a warning message and refuse to do it. We don't
// impress anyone by spewing tons of binary goo to a terminal.
- if (!Force && !NoOutput && CheckBytecodeOutputToConsole(Out,!Quiet)) {
+ if (!Force && !NoOutput && CheckBitcodeOutputToConsole(Out,!Quiet)) {
NoOutput = true;
}
if (!NoVerify && !VerifyEach)
Passes.add(createVerifierPass());
- // Write bytecode out to disk or cout as the last step...
+ // Write bitcode out to disk or cout as the last step...
if (!NoOutput && !AnalyzeOnly)
Passes.add(CreateBitcodeWriterPass(*Out));