mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-11 11:34:02 +00:00
* Doxygenified comments, simplifying them and shortening in the process
* Eliminated extra space git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10104 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ff0cbe175d
commit
9839969110
@ -90,56 +90,41 @@ namespace {
|
|||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
//
|
/// PrintAndReturn - Prints a message to standard error and returns a value
|
||||||
// Function: PrintAndReturn ()
|
/// usable for an exit status.
|
||||||
//
|
///
|
||||||
// Description:
|
/// Inputs:
|
||||||
// Prints a message (usually error message) to standard error (stderr) and
|
/// progname - The name of the program (i.e. argv[0]).
|
||||||
// returns a value usable for an exit status.
|
/// Message - The message to print to standard error.
|
||||||
//
|
/// Extra - Extra information to print between the program name and thei
|
||||||
// Inputs:
|
/// message. It is optional.
|
||||||
// progname - The name of the program (i.e. argv[0]).
|
///
|
||||||
// Message - The message to print to standard error.
|
/// Return value:
|
||||||
// Extra - Extra information to print between the program name and thei
|
/// Returns a value that can be used as the exit status (i.e. for exit()).
|
||||||
// message. It is optional.
|
///
|
||||||
//
|
|
||||||
// Outputs:
|
|
||||||
// None.
|
|
||||||
//
|
|
||||||
// Return value:
|
|
||||||
// Returns a value that can be used as the exit status (i.e. for exit()).
|
|
||||||
//
|
|
||||||
int
|
int
|
||||||
PrintAndReturn (const char *progname,
|
PrintAndReturn(const char *progname,
|
||||||
const std::string &Message,
|
const std::string &Message,
|
||||||
const std::string &Extra)
|
const std::string &Extra)
|
||||||
{
|
{
|
||||||
std::cerr << progname << Extra << ": " << Message << "\n";
|
std::cerr << progname << Extra << ": " << Message << "\n";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
/// CopyEnv - This function takes an array of environment variables and makes a
|
||||||
//
|
/// copy of it. This copy can then be manipulated any way the caller likes
|
||||||
// Function: CopyEnv()
|
/// without affecting the process's real environment.
|
||||||
//
|
///
|
||||||
// Description:
|
/// Inputs:
|
||||||
// This function takes an array of environment variables and makes a
|
/// envp - An array of C strings containing an environment.
|
||||||
// copy of it. This copy can then be manipulated any way the caller likes
|
///
|
||||||
// without affecting the process's real environment.
|
/// Return value:
|
||||||
//
|
/// NULL - An error occurred.
|
||||||
// Inputs:
|
///
|
||||||
// envp - An array of C strings containing an environment.
|
/// Otherwise, a pointer to a new array of C strings is returned. Every string
|
||||||
//
|
/// in the array is a duplicate of the one in the original array (i.e. we do
|
||||||
// Outputs:
|
/// not copy the char *'s from one array to another).
|
||||||
// None.
|
///
|
||||||
//
|
|
||||||
// Return value:
|
|
||||||
// NULL - An error occurred.
|
|
||||||
//
|
|
||||||
// Otherwise, a pointer to a new array of C strings is returned. Every string
|
|
||||||
// in the array is a duplicate of the one in the original array (i.e. we do
|
|
||||||
// not copy the char *'s from one array to another).
|
|
||||||
//
|
|
||||||
char ** CopyEnv(char ** const envp) {
|
char ** CopyEnv(char ** const envp) {
|
||||||
// Count the number of entries in the old list;
|
// Count the number of entries in the old list;
|
||||||
unsigned entries; // The number of entries in the old environment list
|
unsigned entries; // The number of entries in the old environment list
|
||||||
@ -173,28 +158,19 @@ char ** CopyEnv(char ** const envp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
/// RemoveEnv - Remove the specified environment variable from the environment
|
||||||
// Function: RemoveEnv()
|
/// array.
|
||||||
//
|
///
|
||||||
// Description:
|
/// Inputs:
|
||||||
// Remove the specified environment variable from the environment array.
|
/// name - The name of the variable to remove. It cannot be NULL.
|
||||||
//
|
/// envp - The array of environment variables. It cannot be NULL.
|
||||||
// Inputs:
|
///
|
||||||
// name - The name of the variable to remove. It cannot be NULL.
|
/// Notes:
|
||||||
// envp - The array of environment variables. It cannot be NULL.
|
/// This is mainly done because functions to remove items from the environment
|
||||||
//
|
/// are not available across all platforms. In particular, Solaris does not
|
||||||
// Outputs:
|
/// seem to have an unsetenv() function or a setenv() function (or they are
|
||||||
// envp - The pointer to the specified variable name is removed.
|
/// undocumented if they do exist).
|
||||||
//
|
///
|
||||||
// Return value:
|
|
||||||
// None.
|
|
||||||
//
|
|
||||||
// Notes:
|
|
||||||
// This is mainly done because functions to remove items from the environment
|
|
||||||
// are not available across all platforms. In particular, Solaris does not
|
|
||||||
// seem to have an unsetenv() function or a setenv() function (or they are
|
|
||||||
// undocumented if they do exist).
|
|
||||||
//
|
|
||||||
void RemoveEnv(const char * name, char ** const envp) {
|
void RemoveEnv(const char * name, char ** const envp) {
|
||||||
for (unsigned index=0; envp[index] != NULL; index++) {
|
for (unsigned index=0; envp[index] != NULL; index++) {
|
||||||
// Find the first equals sign in the array and make it an EOS character.
|
// Find the first equals sign in the array and make it an EOS character.
|
||||||
@ -220,7 +196,7 @@ void RemoveEnv(const char * name, char ** const envp) {
|
|||||||
int main(int argc, char **argv, char **envp) {
|
int main(int argc, char **argv, char **envp) {
|
||||||
cl::ParseCommandLineOptions(argc, argv, " llvm linker for GCC\n");
|
cl::ParseCommandLineOptions(argc, argv, " llvm linker for GCC\n");
|
||||||
|
|
||||||
std::string ModuleID ("gccld-output");
|
std::string ModuleID("gccld-output");
|
||||||
std::auto_ptr<Module> Composite(new Module(ModuleID));
|
std::auto_ptr<Module> Composite(new Module(ModuleID));
|
||||||
|
|
||||||
// We always look first in the current directory when searching for libraries.
|
// We always look first in the current directory when searching for libraries.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user