Skip to content

Commit

Permalink
Here is the bulk of the sanitizing.
Browse files Browse the repository at this point in the history
Almost all occurrences of "bytecode" in the sources have been eliminated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37913 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
ggreif committed Jul 5, 2007
1 parent f8ad955 commit a99be51
Show file tree
Hide file tree
Showing 49 changed files with 198 additions and 198 deletions.
4 changes: 2 additions & 2 deletions examples/ModuleMaker/ModuleMaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===//
//
// 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.
//
//===----------------------------------------------------------------------===//
Expand Down Expand Up @@ -52,7 +52,7 @@ int main() {
// 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.
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/AbstractTypeUser.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DerivedType;
///
/// 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.
Expand Down
2 changes: 1 addition & 1 deletion include/llvm/Analysis/ConstantsScanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===//
//
// 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.
//
//===----------------------------------------------------------------------===//
Expand Down
22 changes: 11 additions & 11 deletions include/llvm/Bitcode/Archive.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
//
//===----------------------------------------------------------------------===//

#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"
Expand Down Expand Up @@ -377,13 +377,13 @@ class Archive {
/// @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
Expand Down Expand Up @@ -418,13 +418,13 @@ class Archive {
);

/// 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
Expand All @@ -433,7 +433,7 @@ class Archive {
/// 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
Expand Down Expand Up @@ -525,7 +525,7 @@ class Archive {
/// @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
Expand Down
4 changes: 2 additions & 2 deletions include/llvm/GlobalValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ class GlobalValue : public Constant {
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.
Expand Down
14 changes: 7 additions & 7 deletions include/llvm/Linker.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Module;
/// 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
Expand Down Expand Up @@ -162,10 +162,10 @@ class Linker {
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
Expand All @@ -174,9 +174,9 @@ class Linker {
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
Expand Down Expand Up @@ -216,7 +216,7 @@ class Linker {
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
Expand Down Expand Up @@ -271,7 +271,7 @@ class Linker {
/// @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);

Expand Down
4 changes: 2 additions & 2 deletions include/llvm/Support/SystemUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ namespace llvm {

/// 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
);
Expand Down
6 changes: 3 additions & 3 deletions include/llvm/System/Path.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ namespace sys {
/// @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.
Expand Down
4 changes: 2 additions & 2 deletions include/llvm/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class TypeMapBase;
///
/// 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.
///
Expand All @@ -77,7 +77,7 @@ class Type : public AbstractTypeUser {
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
Expand Down
16 changes: 8 additions & 8 deletions lib/Archive/Archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ static void getSymbols(Module*M, std::vector<std::string>& symbols) {
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()));
Expand Down Expand Up @@ -242,10 +242,10 @@ bool llvm::GetBytecodeSymbols(const sys::Path& fName,
}

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);
Expand Down
20 changes: 10 additions & 10 deletions lib/Archive/ArchiveInternals.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===-- lib/Bytecode/ArchiveInternals.h -------------------------*- C++ -*-===//
//===-- lib/Archive/ArchiveInternals.h -------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
Expand All @@ -11,8 +11,8 @@
//
//===----------------------------------------------------------------------===//

#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"
Expand All @@ -29,7 +29,7 @@

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
Expand Down Expand Up @@ -67,15 +67,15 @@ namespace llvm {
}
};

// 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
Expand Down
22 changes: 11 additions & 11 deletions lib/Archive/ArchiveReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
// Builds up standard unix archive files (.a) containing LLVM bytecode.
// Builds up standard unix archive files (.a) containing LLVM bitcode.
//
//===----------------------------------------------------------------------===//

Expand Down Expand Up @@ -109,7 +109,7 @@ Archive::parseMemberHeader(const char*& At, const char* End, std::string* error)
// 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.

Expand Down Expand Up @@ -344,7 +344,7 @@ Archive::OpenAndLoad(const sys::Path& file, std::string* ErrorMessage)
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) {

Expand Down Expand Up @@ -487,7 +487,7 @@ Archive::findModuleDefiningSymbol(const std::string& symbol,
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(),
Expand Down Expand Up @@ -541,8 +541,8 @@ Archive::findModulesDefiningSymbols(std::set<std::string>& symbols,
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
Expand All @@ -555,7 +555,7 @@ Archive::findModulesDefiningSymbols(std::set<std::string>& symbols,
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;
Expand Down Expand Up @@ -591,7 +591,7 @@ Archive::findModulesDefiningSymbols(std::set<std::string>& symbols,
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())
Expand All @@ -602,14 +602,14 @@ bool Archive::isBytecodeArchive() {
// 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())
Expand All @@ -624,7 +624,7 @@ bool Archive::isBytecodeArchive() {
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;
}
Expand Down
Loading

0 comments on commit a99be51

Please sign in to comment.