[lld] r226287 - Simplify. No functionality change.
Rui Ueyama
ruiu at google.com
Fri Jan 16 08:58:58 PST 2015
Author: ruiu
Date: Fri Jan 16 10:58:58 2015
New Revision: 226287
URL: http://llvm.org/viewvc/llvm-project?rev=226287&view=rev
Log:
Simplify. No functionality change.
Modified:
lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h
lld/trunk/lib/Driver/GnuLdDriver.cpp
Modified: lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h?rev=226287&r1=226286&r2=226287&view=diff
==============================================================================
--- lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h (original)
+++ lld/trunk/include/lld/ReaderWriter/ELFLinkingContext.h Fri Jan 16 10:58:58 2015
@@ -296,16 +296,8 @@ public:
/// ELFFileNode class keeps growing. This achieves code to be clean as well.
class Attributes {
public:
- Attributes()
- : _isWholeArchive(false), _isDashlPrefix(false), _isSysRooted(false) {}
- void setWholeArchive(bool isWholeArchive) {
- _isWholeArchive = isWholeArchive;
- }
- void setDashlPrefix(bool isDashlPrefix) { _isDashlPrefix = isDashlPrefix; }
+ Attributes() : _isSysRooted(false) {}
void setSysRooted(bool isSysRooted) { _isSysRooted = isSysRooted; }
-
- bool _isWholeArchive;
- bool _isDashlPrefix;
bool _isSysRooted;
};
Modified: lld/trunk/lib/Driver/GnuLdDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/GnuLdDriver.cpp?rev=226287&r1=226286&r2=226287&view=diff
==============================================================================
--- lld/trunk/lib/Driver/GnuLdDriver.cpp (original)
+++ lld/trunk/lib/Driver/GnuLdDriver.cpp Fri Jan 16 10:58:58 2015
@@ -257,10 +257,6 @@ evaluateLinkerScript(ELFLinkingContext &
int numfiles = 0;
for (const script::Path &path : group->getPaths()) {
// TODO : Propagate Set WholeArchive/dashlPrefix
- ELFLinkingContext::Attributes attr;
- attr.setSysRooted(sysroot);
- attr.setDashlPrefix(path._isDashlPrefix);
-
ErrorOr<StringRef> pathOrErr = path._isDashlPrefix
? ctx.searchLibrary(path._path) : ctx.searchFile(path._path, sysroot);
if (std::error_code ec = pathOrErr.getError())
@@ -355,8 +351,8 @@ bool GnuLdDriver::parse(int argc, const
std::stack<int> groupStack;
int numfiles = 0;
- ELFLinkingContext::Attributes attributes;
bool asNeeded = false;
+ bool wholeArchive = false;
bool _outputOptionSet = false;
@@ -508,11 +504,11 @@ bool GnuLdDriver::parse(int argc, const
break;
case OPT_no_whole_archive:
- attributes.setWholeArchive(false);
+ wholeArchive = false;
break;
case OPT_whole_archive:
- attributes.setWholeArchive(true);
+ wholeArchive = true;
break;
case OPT_as_needed:
@@ -583,7 +579,6 @@ bool GnuLdDriver::parse(int argc, const
case OPT_INPUT:
case OPT_l: {
bool dashL = (inputArg->getOption().getID() == OPT_l);
- attributes.setDashlPrefix(dashL);
StringRef path = inputArg->getValue();
ErrorOr<StringRef> pathOrErr = findFile(*ctx, path, dashL);
@@ -608,7 +603,7 @@ bool GnuLdDriver::parse(int argc, const
break;
}
std::vector<std::unique_ptr<File>> files
- = loadFile(*ctx, realpath, attributes._isWholeArchive);
+ = loadFile(*ctx, realpath, wholeArchive);
for (std::unique_ptr<File> &file : files) {
if (ctx->logInputFiles())
diagnostics << file->path() << "\n";
More information about the llvm-commits
mailing list