summaryrefslogtreecommitdiffstats
path: root/lib/Linker
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-06 10:58:06 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-06 10:58:06 +0000
commit2928c83b010f7cfdb0f819199d806f6942a7d995 (patch)
tree0c5a62b287e4c2c693330584a8f1d6024defde66 /lib/Linker
parentc128b3e74eaba34a8f6d2b8c3dc19861b9cbd901 (diff)
downloadexternal_llvm-2928c83b010f7cfdb0f819199d806f6942a7d995.zip
external_llvm-2928c83b010f7cfdb0f819199d806f6942a7d995.tar.gz
external_llvm-2928c83b010f7cfdb0f819199d806f6942a7d995.tar.bz2
Pass StringRef by value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86251 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker')
-rw-r--r--lib/Linker/LinkItems.cpp2
-rw-r--r--lib/Linker/Linker.cpp16
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/Linker/LinkItems.cpp b/lib/Linker/LinkItems.cpp
index 61f3c26..494a013 100644
--- a/lib/Linker/LinkItems.cpp
+++ b/lib/Linker/LinkItems.cpp
@@ -70,7 +70,7 @@ Linker::LinkInItems(const ItemList& Items, ItemList& NativeItems) {
/// LinkInLibrary - links one library into the HeadModule.
///
-bool Linker::LinkInLibrary(const StringRef &Lib, bool& is_native) {
+bool Linker::LinkInLibrary(StringRef Lib, bool& is_native) {
is_native = false;
// Determine where this library lives.
sys::Path Pathname = FindLib(Lib);
diff --git a/lib/Linker/Linker.cpp b/lib/Linker/Linker.cpp
index aef79d0..32aa0f9 100644
--- a/lib/Linker/Linker.cpp
+++ b/lib/Linker/Linker.cpp
@@ -20,8 +20,8 @@
#include "llvm/Config/config.h"
using namespace llvm;
-Linker::Linker(const StringRef &progname, const StringRef &modname,
- LLVMContext& C, unsigned flags):
+Linker::Linker(StringRef progname, StringRef modname,
+ LLVMContext& C, unsigned flags):
Context(C),
Composite(new Module(modname, C)),
LibPaths(),
@@ -29,7 +29,7 @@ Linker::Linker(const StringRef &progname, const StringRef &modname,
Error(),
ProgramName(progname) { }
-Linker::Linker(const StringRef &progname, Module* aModule, unsigned flags) :
+Linker::Linker(StringRef progname, Module* aModule, unsigned flags) :
Context(aModule->getContext()),
Composite(aModule),
LibPaths(),
@@ -42,7 +42,7 @@ Linker::~Linker() {
}
bool
-Linker::error(const StringRef &message) {
+Linker::error(StringRef message) {
Error = message;
if (!(Flags&QuietErrors))
errs() << ProgramName << ": error: " << message << "\n";
@@ -50,7 +50,7 @@ Linker::error(const StringRef &message) {
}
bool
-Linker::warning(const StringRef &message) {
+Linker::warning(StringRef message) {
Error = message;
if (!(Flags&QuietWarnings))
errs() << ProgramName << ": warning: " << message << "\n";
@@ -58,7 +58,7 @@ Linker::warning(const StringRef &message) {
}
void
-Linker::verbose(const StringRef &message) {
+Linker::verbose(StringRef message) {
if (Flags&Verbose)
errs() << " " << message << "\n";
}
@@ -114,7 +114,7 @@ Linker::LoadObject(const sys::Path &FN) {
// IsLibrary - Determine if "Name" is a library in "Directory". Return
// a non-empty sys::Path if its found, an empty one otherwise.
-static inline sys::Path IsLibrary(const StringRef &Name,
+static inline sys::Path IsLibrary(StringRef Name,
const sys::Path &Directory) {
sys::Path FullPath(Directory);
@@ -153,7 +153,7 @@ static inline sys::Path IsLibrary(const StringRef &Name,
/// Path if no matching file can be found.
///
sys::Path
-Linker::FindLib(const StringRef &Filename) {
+Linker::FindLib(StringRef Filename) {
// Determine if the pathname can be found as it stands.
sys::Path FilePath(Filename);
if (FilePath.canRead() &&