[PATCH] Rename path() -> getPath().
Rui Ueyama
ruiu at google.com
Mon Oct 7 21:38:22 PDT 2013
Hi shankarke,
http://llvm-reviews.chandlerc.com/D1853
Files:
include/lld/Driver/CoreInputGraph.h
include/lld/Driver/DarwinInputGraph.h
include/lld/Driver/InputGraph.h
include/lld/Driver/WinLinkInputGraph.h
lib/Driver/WinLinkDriver.cpp
unittests/DriverTests/DriverTest.h
Index: include/lld/Driver/CoreInputGraph.h
===================================================================
--- include/lld/Driver/CoreInputGraph.h
+++ include/lld/Driver/CoreInputGraph.h
@@ -42,7 +42,7 @@
/// \brief Parse the input file to lld::File.
error_code parse(const LinkingContext &ctx, raw_ostream &diagnostics) {
- ErrorOr<StringRef> filePath = path(ctx);
+ ErrorOr<StringRef> filePath = getPath(ctx);
if (!filePath &&
error_code(filePath) == llvm::errc::no_such_file_or_directory)
return make_error_code(llvm::errc::no_such_file_or_directory);
Index: include/lld/Driver/DarwinInputGraph.h
===================================================================
--- include/lld/Driver/DarwinInputGraph.h
+++ include/lld/Driver/DarwinInputGraph.h
@@ -42,7 +42,7 @@
/// \brief Parse the input file to lld::File.
llvm::error_code parse(const LinkingContext &ctx, raw_ostream &diagnostics) {
- ErrorOr<StringRef> filePath = path(ctx);
+ ErrorOr<StringRef> filePath = getPath(ctx);
if (!filePath &&
error_code(filePath) == llvm::errc::no_such_file_or_directory)
return make_error_code(llvm::errc::no_such_file_or_directory);
Index: include/lld/Driver/InputGraph.h
===================================================================
--- include/lld/Driver/InputGraph.h
+++ include/lld/Driver/InputGraph.h
@@ -249,7 +249,7 @@
FileNode(StringRef path, int64_t ordinal = -1)
: InputElement(InputElement::Kind::File, ordinal), _path(path) {}
- virtual llvm::ErrorOr<StringRef> path(const LinkingContext &) const {
+ virtual ErrorOr<StringRef> getPath(const LinkingContext &) const {
return _path;
}
Index: include/lld/Driver/WinLinkInputGraph.h
===================================================================
--- include/lld/Driver/WinLinkInputGraph.h
+++ include/lld/Driver/WinLinkInputGraph.h
@@ -35,11 +35,11 @@
return a->kind() == InputElement::Kind::File;
}
- virtual llvm::ErrorOr<StringRef> path(const LinkingContext &ctx) const;
+ virtual llvm::ErrorOr<StringRef> getPath(const LinkingContext &ctx) const;
/// \brief Parse the input file to lld::File.
llvm::error_code parse(const LinkingContext &ctx, raw_ostream &diagnostics) {
- ErrorOr<StringRef> filePath = path(ctx);
+ ErrorOr<StringRef> filePath = getPath(ctx);
if (!filePath &&
error_code(filePath) == llvm::errc::no_such_file_or_directory)
return make_error_code(llvm::errc::no_such_file_or_directory);
@@ -107,7 +107,7 @@
PECOFFLibraryNode(PECOFFLinkingContext &ctx, StringRef path)
: PECOFFFileNode(ctx, path) {}
- virtual llvm::ErrorOr<StringRef> path(const LinkingContext &ctx) const;
+ virtual llvm::ErrorOr<StringRef> getPath(const LinkingContext &ctx) const;
};
} // namespace lld
Index: lib/Driver/WinLinkDriver.cpp
===================================================================
--- lib/Driver/WinLinkDriver.cpp
+++ lib/Driver/WinLinkDriver.cpp
@@ -238,15 +238,15 @@
} // namespace
-llvm::ErrorOr<StringRef> PECOFFFileNode::path(const LinkingContext &) const {
+ErrorOr<StringRef> PECOFFFileNode::getPath(const LinkingContext &) const {
if (_path.endswith(".lib"))
return _ctx.searchLibraryFile(_path);
if (llvm::sys::path::extension(_path).empty())
return _ctx.allocateString(_path.str() + ".obj");
return _path;
}
-llvm::ErrorOr<StringRef> PECOFFLibraryNode::path(const LinkingContext &) const {
+ErrorOr<StringRef> PECOFFLibraryNode::getPath(const LinkingContext &) const {
if (!_path.endswith(".lib"))
return _ctx.searchLibraryFile(_ctx.allocateString(_path.str() + ".lib"));
return _ctx.searchLibraryFile(_path);
@@ -536,7 +536,7 @@
// with ".exe".
if (ctx.outputPath().empty()) {
SmallString<128> firstInputFilePath =
- *llvm::dyn_cast<FileNode>(&inputGraph[0])->path(ctx);
+ *dyn_cast<FileNode>(&inputGraph[0])->getPath(ctx);
llvm::sys::path::replace_extension(firstInputFilePath, ".exe");
ctx.setOutputPath(ctx.allocateString(firstInputFilePath.str()));
}
Index: unittests/DriverTests/DriverTest.h
===================================================================
--- unittests/DriverTests/DriverTest.h
+++ unittests/DriverTests/DriverTest.h
@@ -35,8 +35,7 @@
std::string inputFile(unsigned index) {
const InputElement &inputElement = linkingContext()->inputGraph()[index];
if (inputElement.kind() == InputElement::Kind::File)
- return *(llvm::dyn_cast<FileNode>(&inputElement))
- ->path(*linkingContext());
+ return *(dyn_cast<FileNode>(&inputElement))->getPath(*linkingContext());
llvm_unreachable("not handling other types of input files");
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1853.1.patch
Type: text/x-patch
Size: 4725 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131007/552702e9/attachment.bin>
More information about the llvm-commits
mailing list