[lld] r240346 - Fix missed formatting in prior commit (mostly 80 cols violation and some whitespace around *)
David Blaikie
dblaikie at gmail.com
Mon Jun 22 15:06:48 PDT 2015
Author: dblaikie
Date: Mon Jun 22 17:06:48 2015
New Revision: 240346
URL: http://llvm.org/viewvc/llvm-project?rev=240346&view=rev
Log:
Fix missed formatting in prior commit (mostly 80 cols violation and some whitespace around *)
Modified:
lld/trunk/COFF/Driver.cpp
lld/trunk/COFF/Driver.h
lld/trunk/COFF/DriverUtils.cpp
lld/trunk/include/lld/Driver/Driver.h
lld/trunk/lib/Driver/CoreDriver.cpp
lld/trunk/lib/Driver/DarwinLdDriver.cpp
lld/trunk/lib/Driver/GnuLdDriver.cpp
lld/trunk/lib/Driver/UniversalDriver.cpp
lld/trunk/lib/Driver/WinLinkDriver.cpp
Modified: lld/trunk/COFF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=240346&r1=240345&r2=240346&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.cpp (original)
+++ lld/trunk/COFF/Driver.cpp Mon Jun 22 17:06:48 2015
@@ -43,7 +43,7 @@ namespace coff {
Configuration *Config;
LinkerDriver *Driver;
-bool link(llvm::ArrayRef<const char*> Args) {
+bool link(llvm::ArrayRef<const char *> Args) {
auto C = make_unique<Configuration>();
Config = C.get();
auto D = make_unique<LinkerDriver>();
@@ -214,7 +214,7 @@ static WindowsSubsystem inferSubsystem()
.Default(IMAGE_SUBSYSTEM_UNKNOWN);
}
-bool LinkerDriver::link(llvm::ArrayRef<const char*> ArgsArr) {
+bool LinkerDriver::link(llvm::ArrayRef<const char *> ArgsArr) {
// Needed for LTO.
llvm::InitializeAllTargetInfos();
llvm::InitializeAllTargets();
Modified: lld/trunk/COFF/Driver.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.h?rev=240346&r1=240345&r2=240346&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.h (original)
+++ lld/trunk/COFF/Driver.h Mon Jun 22 17:06:48 2015
@@ -35,7 +35,7 @@ using llvm::Optional;
class InputFile;
// Entry point of the COFF linker.
-bool link(llvm::ArrayRef<const char*> Args);
+bool link(llvm::ArrayRef<const char *> Args);
class ArgParser {
public:
@@ -65,7 +65,7 @@ private:
class LinkerDriver {
public:
LinkerDriver() : Alloc(AllocAux) {}
- bool link(llvm::ArrayRef<const char*> Args);
+ bool link(llvm::ArrayRef<const char *> Args);
// Used by the resolver to parse .drectve section contents.
std::error_code
Modified: lld/trunk/COFF/DriverUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/DriverUtils.cpp?rev=240346&r1=240345&r2=240346&view=diff
==============================================================================
--- lld/trunk/COFF/DriverUtils.cpp (original)
+++ lld/trunk/COFF/DriverUtils.cpp Mon Jun 22 17:06:48 2015
@@ -571,7 +571,7 @@ ArgParser::parse(std::vector<const char
}
ErrorOr<std::unique_ptr<llvm::opt::InputArgList>>
-ArgParser::parse(llvm::ArrayRef<const char*> Args) {
+ArgParser::parse(llvm::ArrayRef<const char *> Args) {
Args = Args.slice(1);
std::vector<const char *> V(Args.begin(), Args.end());
return parse(V);
Modified: lld/trunk/include/lld/Driver/Driver.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Driver/Driver.h?rev=240346&r1=240345&r2=240346&view=diff
==============================================================================
--- lld/trunk/include/lld/Driver/Driver.h (original)
+++ lld/trunk/include/lld/Driver/Driver.h Mon Jun 22 17:06:48 2015
@@ -55,7 +55,7 @@ private:
class UniversalDriver : public Driver {
public:
/// Determine flavor and pass control to Driver for that flavor.
- static bool link(llvm::MutableArrayRef<const char*> args,
+ static bool link(llvm::MutableArrayRef<const char *> args,
raw_ostream &diag = llvm::errs());
private:
@@ -67,12 +67,12 @@ class GnuLdDriver : public Driver {
public:
/// Parses command line arguments same as gnu/binutils ld and performs link.
/// Returns true iff an error occurred.
- static bool linkELF(llvm::ArrayRef<const char*> args,
+ static bool linkELF(llvm::ArrayRef<const char *> args,
raw_ostream &diag = llvm::errs());
/// Uses gnu/binutils style ld command line options to fill in options struct.
/// Returns true iff there was an error.
- static bool parse(llvm::ArrayRef<const char*> args,
+ static bool parse(llvm::ArrayRef<const char *> args,
std::unique_ptr<ELFLinkingContext> &context,
raw_ostream &diag = llvm::errs());
@@ -103,12 +103,13 @@ class DarwinLdDriver : public Driver {
public:
/// Parses command line arguments same as darwin's ld and performs link.
/// Returns true iff there was an error.
- static bool linkMachO(llvm::ArrayRef<const char*> args,
+ static bool linkMachO(llvm::ArrayRef<const char *> args,
raw_ostream &diag = llvm::errs());
/// Uses darwin style ld command line options to update LinkingContext object.
/// Returns true iff there was an error.
- static bool parse(llvm::ArrayRef<const char*> args, MachOLinkingContext &info,
+ static bool parse(llvm::ArrayRef<const char *> args,
+ MachOLinkingContext &info,
raw_ostream &diag = llvm::errs());
private:
@@ -120,19 +121,19 @@ class WinLinkDriver : public Driver {
public:
/// Parses command line arguments same as Windows link.exe and performs link.
/// Returns true iff there was an error.
- static bool linkPECOFF(llvm::ArrayRef<const char*> args,
+ static bool linkPECOFF(llvm::ArrayRef<const char *> args,
raw_ostream &diag = llvm::errs());
/// Uses Windows style link command line options to fill in options struct.
/// Returns true iff there was an error.
- static bool parse(llvm::ArrayRef<const char*> args, PECOFFLinkingContext &info,
- raw_ostream &diag = llvm::errs(),
- bool isDirective = false);
+ static bool parse(llvm::ArrayRef<const char *> args,
+ PECOFFLinkingContext &info,
+ raw_ostream &diag = llvm::errs(), bool isDirective = false);
// Same as parse(), but restricted to the context of directives.
- static bool parseDirectives(int argc, const char** argv,
- PECOFFLinkingContext &info,
- raw_ostream &diag = llvm::errs()) {
+ static bool parseDirectives(int argc, const char **argv,
+ PECOFFLinkingContext &info,
+ raw_ostream &diag = llvm::errs()) {
return parse(llvm::makeArrayRef(argv, argc), info, diag, true);
}
@@ -142,7 +143,7 @@ private:
/// Driver for Windows 'link.exe' command line options
namespace coff {
-bool link(llvm::ArrayRef<const char*> args);
+bool link(llvm::ArrayRef<const char *> args);
}
/// Driver for lld unit tests
@@ -150,12 +151,12 @@ class CoreDriver : public Driver {
public:
/// Parses command line arguments same as lld-core and performs link.
/// Returns true iff there was an error.
- static bool link(llvm::ArrayRef<const char*> args,
+ static bool link(llvm::ArrayRef<const char *> args,
raw_ostream &diag = llvm::errs());
/// Uses lld-core command line options to fill in options struct.
/// Returns true iff there was an error.
- static bool parse(llvm::ArrayRef<const char*> args, CoreLinkingContext &info,
+ static bool parse(llvm::ArrayRef<const char *> args, CoreLinkingContext &info,
raw_ostream &diag = llvm::errs());
private:
Modified: lld/trunk/lib/Driver/CoreDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/CoreDriver.cpp?rev=240346&r1=240345&r2=240346&view=diff
==============================================================================
--- lld/trunk/lib/Driver/CoreDriver.cpp (original)
+++ lld/trunk/lib/Driver/CoreDriver.cpp Mon Jun 22 17:06:48 2015
@@ -73,7 +73,8 @@ static const Registry::KindStrings coreK
LLD_KIND_STRING_END
};
-bool CoreDriver::link(llvm::ArrayRef<const char*> args, raw_ostream &diagnostics) {
+bool CoreDriver::link(llvm::ArrayRef<const char *> args,
+ raw_ostream &diagnostics) {
CoreLinkingContext ctx;
// Register possible input file parsers.
@@ -86,8 +87,8 @@ bool CoreDriver::link(llvm::ArrayRef<con
return Driver::link(ctx);
}
-bool CoreDriver::parse(llvm::ArrayRef<const char*> args, CoreLinkingContext &ctx,
- raw_ostream &diagnostics) {
+bool CoreDriver::parse(llvm::ArrayRef<const char *> args,
+ CoreLinkingContext &ctx, raw_ostream &diagnostics) {
// Parse command line options using CoreOptions.td
std::unique_ptr<llvm::opt::InputArgList> parsedArgs;
CoreOptTable table;
Modified: lld/trunk/lib/Driver/DarwinLdDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/DarwinLdDriver.cpp?rev=240346&r1=240345&r2=240346&view=diff
==============================================================================
--- lld/trunk/lib/Driver/DarwinLdDriver.cpp (original)
+++ lld/trunk/lib/Driver/DarwinLdDriver.cpp Mon Jun 22 17:06:48 2015
@@ -267,7 +267,7 @@ static bool parseNumberBase16(StringRef
namespace lld {
-bool DarwinLdDriver::linkMachO(llvm::ArrayRef<const char*> args,
+bool DarwinLdDriver::linkMachO(llvm::ArrayRef<const char *> args,
raw_ostream &diagnostics) {
MachOLinkingContext ctx;
if (!parse(args, ctx, diagnostics))
Modified: lld/trunk/lib/Driver/GnuLdDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdDriver.cpp?rev=240346&r1=240345&r2=240346&view=diff
==============================================================================
--- lld/trunk/lib/Driver/GnuLdDriver.cpp (original)
+++ lld/trunk/lib/Driver/GnuLdDriver.cpp Mon Jun 22 17:06:48 2015
@@ -82,8 +82,9 @@ public:
// at the original @file position. If file cannot be read, @file is not expanded
// and left unmodified. @file can appear in a response file, so it's a recursive
// process.
-static llvm::ArrayRef<const char*>
-maybeExpandResponseFiles(llvm::ArrayRef<const char*> args, BumpPtrAllocator &alloc) {
+static llvm::ArrayRef<const char *>
+maybeExpandResponseFiles(llvm::ArrayRef<const char *> args,
+ BumpPtrAllocator &alloc) {
// Expand response files.
SmallVector<const char *, 256> smallvec;
for (const char *arg : args)
@@ -133,7 +134,8 @@ static bool parseMaxPageSize(StringRef o
return true;
}
-bool GnuLdDriver::linkELF(llvm::ArrayRef<const char*> args, raw_ostream &diag) {
+bool GnuLdDriver::linkELF(llvm::ArrayRef<const char *> args,
+ raw_ostream &diag) {
BumpPtrAllocator alloc;
args = maybeExpandResponseFiles(args, alloc);
std::unique_ptr<ELFLinkingContext> options;
@@ -337,7 +339,7 @@ getBool(const llvm::opt::InputArgList &p
return llvm::None;
}
-bool GnuLdDriver::parse(llvm::ArrayRef<const char*> args,
+bool GnuLdDriver::parse(llvm::ArrayRef<const char *> args,
std::unique_ptr<ELFLinkingContext> &context,
raw_ostream &diag) {
// Parse command line options using GnuLdOptions.td
@@ -346,8 +348,7 @@ bool GnuLdDriver::parse(llvm::ArrayRef<c
unsigned missingIndex;
unsigned missingCount;
- parsedArgs.reset(table.ParseArgs(args.slice(1),
- missingIndex, missingCount));
+ parsedArgs.reset(table.ParseArgs(args.slice(1), missingIndex, missingCount));
if (missingCount) {
diag << "error: missing arg value for '"
<< parsedArgs->getArgString(missingIndex) << "' expected "
Modified: lld/trunk/lib/Driver/UniversalDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/UniversalDriver.cpp?rev=240346&r1=240345&r2=240346&view=diff
==============================================================================
--- lld/trunk/lib/Driver/UniversalDriver.cpp (original)
+++ lld/trunk/lib/Driver/UniversalDriver.cpp Mon Jun 22 17:06:48 2015
@@ -127,14 +127,15 @@ static ProgramNameParts parseProgramName
// Removes the argument from argv along with its value, if exists, and updates
// argc.
-static void removeArg(llvm::opt::Arg *arg, llvm::MutableArrayRef<const char*> &args) {
+static void removeArg(llvm::opt::Arg *arg,
+ llvm::MutableArrayRef<const char *> &args) {
unsigned int numToRemove = arg->getNumValues() + 1;
auto sub = args.slice(arg->getIndex() + 1);
std::rotate(sub.begin(), sub.begin() + numToRemove, sub.end());
args = args.drop_back(numToRemove);
}
-static Flavor getFlavor(llvm::MutableArrayRef<const char*> &args,
+static Flavor getFlavor(llvm::MutableArrayRef<const char *> &args,
std::unique_ptr<llvm::opt::InputArgList> &parsedArgs) {
if (llvm::opt::Arg *argCore = parsedArgs->getLastArg(OPT_core)) {
removeArg(argCore, args);
@@ -162,7 +163,7 @@ static Flavor getFlavor(llvm::MutableArr
namespace lld {
-bool UniversalDriver::link(llvm::MutableArrayRef<const char*> args,
+bool UniversalDriver::link(llvm::MutableArrayRef<const char *> args,
raw_ostream &diagnostics) {
// Parse command line options using GnuLdOptions.td
std::unique_ptr<llvm::opt::InputArgList> parsedArgs;
@@ -173,8 +174,7 @@ bool UniversalDriver::link(llvm::Mutable
// Program name
StringRef programName = llvm::sys::path::stem(args[0]);
- parsedArgs.reset(table.ParseArgs(args.slice(1),
- missingIndex, missingCount));
+ parsedArgs.reset(table.ParseArgs(args.slice(1), missingIndex, missingCount));
if (missingCount) {
diagnostics << "error: missing arg value for '"
Modified: lld/trunk/lib/Driver/WinLinkDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkDriver.cpp?rev=240346&r1=240345&r2=240346&view=diff
==============================================================================
--- lld/trunk/lib/Driver/WinLinkDriver.cpp (original)
+++ lld/trunk/lib/Driver/WinLinkDriver.cpp Mon Jun 22 17:06:48 2015
@@ -665,8 +665,8 @@ handleFailIfMismatchOption(StringRef opt
// Process "LINK" environment variable. If defined, the value of the variable
// should be processed as command line arguments.
-static std::vector<const char *> processLinkEnv(PECOFFLinkingContext &ctx,
- llvm::ArrayRef<const char*> args) {
+static std::vector<const char *>
+processLinkEnv(PECOFFLinkingContext &ctx, llvm::ArrayRef<const char *> args) {
std::vector<const char *> ret;
// The first argument is the name of the command. This should stay at the head
// of the argument list.
@@ -680,7 +680,7 @@ static std::vector<const char *> process
ret.push_back(ctx.allocate(arg).data());
// Add the rest of arguments passed via the command line.
- for (const char* arg : args.slice(1))
+ for (const char *arg : args.slice(1))
ret.push_back(arg);
ret.push_back(nullptr);
return ret;
@@ -713,7 +713,7 @@ static bool readResponseFile(StringRef p
// Expand arguments starting with "@". It's an error if a specified file does
// not exist. Returns true on success.
-static bool expandResponseFiles(llvm::ArrayRef<const char*> &args,
+static bool expandResponseFiles(llvm::ArrayRef<const char *> &args,
PECOFFLinkingContext &ctx, raw_ostream &diag,
bool &expanded) {
std::vector<const char *> newArgv;
@@ -739,7 +739,7 @@ static bool expandResponseFiles(llvm::Ar
// Parses the given command line options and returns the result. Returns NULL if
// there's an error in the options.
static std::unique_ptr<llvm::opt::InputArgList>
-parseArgs(llvm::ArrayRef<const char*> args, PECOFFLinkingContext &ctx,
+parseArgs(llvm::ArrayRef<const char *> args, PECOFFLinkingContext &ctx,
raw_ostream &diag, bool isReadingDirectiveSection) {
// Expand arguments starting with "@".
bool expanded = false;
@@ -751,8 +751,7 @@ parseArgs(llvm::ArrayRef<const char*> ar
WinLinkOptTable table;
unsigned missingIndex;
unsigned missingCount;
- parsedArgs.reset(table.ParseArgs(args.slice(1),
- missingIndex, missingCount));
+ parsedArgs.reset(table.ParseArgs(args.slice(1), missingIndex, missingCount));
if (missingCount) {
diag << "error: missing arg value for '"
<< parsedArgs->getArgString(missingIndex) << "' expected "
@@ -801,7 +800,8 @@ static bool hasLibrary(PECOFFLinkingCont
// If the first command line argument is "/lib", link.exe acts as if it's
// "lib.exe" command. This is for backward compatibility.
// http://msdn.microsoft.com/en-us/library/h34w59b3.aspx
-static bool maybeRunLibCommand(llvm::ArrayRef<const char*> args, raw_ostream &diag) {
+static bool maybeRunLibCommand(llvm::ArrayRef<const char *> args,
+ raw_ostream &diag) {
if (args.size() <= 1)
return false;
if (!StringRef(args[1]).equals_lower("/lib"))
@@ -839,7 +839,8 @@ void addFiles(PECOFFLinkingContext &ctx,
// Main driver
//
-bool WinLinkDriver::linkPECOFF(llvm::ArrayRef<const char*> args, raw_ostream &diag) {
+bool WinLinkDriver::linkPECOFF(llvm::ArrayRef<const char *> args,
+ raw_ostream &diag) {
if (maybeRunLibCommand(args, diag))
return true;
@@ -863,7 +864,7 @@ bool WinLinkDriver::linkPECOFF(llvm::Arr
return link(ctx, diag);
}
-bool WinLinkDriver::parse(llvm::ArrayRef<const char*> args,
+bool WinLinkDriver::parse(llvm::ArrayRef<const char *> args,
PECOFFLinkingContext &ctx, raw_ostream &diag,
bool isReadingDirectiveSection) {
// Parse may be called from multiple threads simultaneously to parse .drectve
More information about the llvm-commits
mailing list