[llvm-commits] [lld] r171909 - /lld/trunk/lib/Driver/LinkerInvocation.cpp
Michael J. Spencer
bigcheesegs at gmail.com
Tue Jan 8 14:59:01 PST 2013
Author: mspencer
Date: Tue Jan 8 16:59:01 2013
New Revision: 171909
URL: http://llvm.org/viewvc/llvm-project?rev=171909&view=rev
Log:
[Driver] Fix indentation.
Modified:
lld/trunk/lib/Driver/LinkerInvocation.cpp
Modified: lld/trunk/lib/Driver/LinkerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/LinkerInvocation.cpp?rev=171909&r1=171908&r2=171909&view=diff
==============================================================================
--- lld/trunk/lib/Driver/LinkerInvocation.cpp (original)
+++ lld/trunk/lib/Driver/LinkerInvocation.cpp Tue Jan 8 16:59:01 2013
@@ -18,58 +18,58 @@
using namespace lld;
void LinkerInvocation::operator()() {
- // Create target.
- std::unique_ptr<Target> target(Target::create(_options));
+ // Create target.
+ std::unique_ptr<Target> target(Target::create(_options));
- if (!target) {
- llvm::errs() << "Failed to create target for " << _options._target
- << "\n";
+ if (!target) {
+ llvm::errs() << "Failed to create target for " << _options._target
+ << "\n";
+ return;
+ }
+
+ // Read inputs
+ InputFiles inputs;
+ for (const auto &input : _options._input) {
+ auto reader = target->getReader(input);
+ if (error_code ec = reader) {
+ llvm::errs() << "Failed to get reader for: " << input.getPath() << ": "
+ << ec.message() << "\n";
return;
}
- // Read inputs
- InputFiles inputs;
- for (const auto &input : _options._input) {
- auto reader = target->getReader(input);
- if (error_code ec = reader) {
- llvm::errs() << "Failed to get reader for: " << input.getPath() << ": "
- << ec.message() << "\n";
- return;
- }
-
- auto buffer = input.getBuffer();
- if (error_code ec = buffer) {
- llvm::errs() << "Failed to read file: " << input.getPath() << ": "
- << ec.message() << "\n";
- return;
- }
-
- std::vector<std::unique_ptr<File>> files;
- if (llvm::error_code ec = reader->readFile(
- buffer->getBufferIdentifier(), files)) {
- llvm::errs() << "Failed to read file: " << input.getPath() << ": "
- << ec.message() << "\n";
- return;
- }
- inputs.appendFiles(files);
+ auto buffer = input.getBuffer();
+ if (error_code ec = buffer) {
+ llvm::errs() << "Failed to read file: " << input.getPath() << ": "
+ << ec.message() << "\n";
+ return;
}
- struct Blah : ResolverOptions {
- Blah()
- : ResolverOptions() {
- _undefinesAreErrors = true;
- }
- } ro;
- Resolver resolver(ro, inputs);
- resolver.resolve();
- File &merged = resolver.resultFile();
-
- auto writer = target->getWriter();
- if (error_code ec = writer) {
- llvm::errs() << "Failed to get writer: " << ec.message() << ".\n";
+ std::vector<std::unique_ptr<File>> files;
+ if (llvm::error_code ec = reader->readFile(
+ buffer->getBufferIdentifier(), files)) {
+ llvm::errs() << "Failed to read file: " << input.getPath() << ": "
+ << ec.message() << "\n";
return;
}
+ inputs.appendFiles(files);
+ }
- if (error_code ec = writer->writeFile(merged, _options._outputPath))
- llvm::errs() << "Failed to write file: " << ec.message() << "\n";
+ struct Blah : ResolverOptions {
+ Blah()
+ : ResolverOptions() {
+ _undefinesAreErrors = true;
+ }
+ } ro;
+ Resolver resolver(ro, inputs);
+ resolver.resolve();
+ File &merged = resolver.resultFile();
+
+ auto writer = target->getWriter();
+ if (error_code ec = writer) {
+ llvm::errs() << "Failed to get writer: " << ec.message() << ".\n";
+ return;
}
+
+ if (error_code ec = writer->writeFile(merged, _options._outputPath))
+ llvm::errs() << "Failed to write file: " << ec.message() << "\n";
+}
More information about the llvm-commits
mailing list