[lld] r195284 - Rename allocateString -> allocate.

Rui Ueyama ruiu at google.com
Wed Nov 20 16:17:31 PST 2013


Author: ruiu
Date: Wed Nov 20 18:17:31 2013
New Revision: 195284

URL: http://llvm.org/viewvc/llvm-project?rev=195284&view=rev
Log:
Rename allocateString -> allocate.

Modified:
    lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h
    lld/trunk/lib/Driver/WinLinkDriver.cpp
    lld/trunk/lib/Driver/WinLinkInputGraph.cpp
    lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp

Modified: lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h?rev=195284&r1=195283&r2=195284&view=diff
==============================================================================
--- lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h (original)
+++ lld/trunk/include/lld/ReaderWriter/PECOFFLinkingContext.h Wed Nov 20 18:17:31 2013
@@ -85,7 +85,7 @@ public:
 
   void registerTemporaryFile(StringRef path) {
     std::unique_ptr<llvm::FileRemover> fileRemover(
-        new llvm::FileRemover(Twine(allocateString(path))));
+        new llvm::FileRemover(Twine(allocate(path))));
     _tempFiles.push_back(std::move(fileRemover));
   }
 
@@ -99,7 +99,7 @@ public:
       return name;
     std::string str = "_";
     str.append(name);
-    return allocateString(str);
+    return allocate(str);
   }
 
   void setEntrySymbolName(StringRef name) {
@@ -237,7 +237,7 @@ public:
   void setDosStub(ArrayRef<uint8_t> data) { _dosStub = data; }
   ArrayRef<uint8_t> getDosStub() const { return _dosStub; }
 
-  StringRef allocateString(StringRef ref) const {
+  StringRef allocate(StringRef ref) const {
     char *x = _allocator.Allocate<char>(ref.size() + 1);
     memcpy(x, ref.data(), ref.size());
     x[ref.size()] = '\0';

Modified: lld/trunk/lib/Driver/WinLinkDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkDriver.cpp?rev=195284&r1=195283&r2=195284&view=diff
==============================================================================
--- lld/trunk/lib/Driver/WinLinkDriver.cpp (original)
+++ lld/trunk/lib/Driver/WinLinkDriver.cpp Wed Nov 20 18:17:31 2013
@@ -269,7 +269,7 @@ StringRef replaceExtension(PECOFFLinking
                            StringRef path, StringRef extension) {
   SmallString<128> val = path;
   llvm::sys::path::replace_extension(val, extension);
-  return ctx.allocateString(val.str());
+  return ctx.allocate(val.str());
 }
 
 // Create a manifest file contents.
@@ -433,7 +433,7 @@ bool createManifest(PECOFFLinkingContext
     if (!createManifestResourceFile(ctx, diagnostics, resourceFilePath))
       return false;
     std::unique_ptr<InputElement> inputElement(
-        new PECOFFFileNode(ctx, ctx.allocateString(resourceFilePath)));
+        new PECOFFFileNode(ctx, ctx.allocate(resourceFilePath)));
     ctx.inputGraph().addInputElement(std::move(inputElement));
     return true;
   }
@@ -478,7 +478,7 @@ std::vector<const char *> processLinkEnv
   llvm::Optional<std::string> env = llvm::sys::Process::GetEnv("LINK");
   if (env.hasValue())
     for (std::string &arg : splitArgList(*env))
-      ret.push_back(context.allocateString(arg).data());
+      ret.push_back(context.allocate(arg).data());
 
   // Add the rest of arguments passed via the command line.
   for (int i = 1; i < argc; ++i)
@@ -493,7 +493,7 @@ void processLibEnv(PECOFFLinkingContext
   llvm::Optional<std::string> env = llvm::sys::Process::GetEnv("LIB");
   if (env.hasValue())
     for (StringRef path : splitPathList(*env))
-      context.appendInputSearchPath(context.allocateString(path));
+      context.appendInputSearchPath(context.allocate(path));
 }
 
 // Returns a default entry point symbol name depending on context image type and
@@ -763,7 +763,7 @@ WinLinkDriver::parse(int argc, const cha
     }
 
     case OPT_manifestfile:
-      ctx.setManifestOutputPath(ctx.allocateString(inputArg->getValue()));
+      ctx.setManifestOutputPath(ctx.allocate(inputArg->getValue()));
       break;
 
     case OPT_manifestdependency:
@@ -771,7 +771,7 @@ WinLinkDriver::parse(int argc, const cha
       // embedded to the manifest XML file with no error check, for link.exe
       // compatibility. We do not gurantete that the resulting XML file is
       // valid.
-      ctx.setManifestDependency(ctx.allocateString(inputArg->getValue()));
+      ctx.setManifestDependency(ctx.allocate(inputArg->getValue()));
       break;
 
     case OPT_failifmismatch:
@@ -781,11 +781,11 @@ WinLinkDriver::parse(int argc, const cha
       break;
 
     case OPT_entry:
-      ctx.setEntrySymbolName(ctx.allocateString(inputArg->getValue()));
+      ctx.setEntrySymbolName(ctx.allocate(inputArg->getValue()));
       break;
 
     case OPT_libpath:
-      ctx.appendInputSearchPath(ctx.allocateString(inputArg->getValue()));
+      ctx.appendInputSearchPath(ctx.allocate(inputArg->getValue()));
       break;
 
     case OPT_debug:
@@ -838,7 +838,7 @@ WinLinkDriver::parse(int argc, const cha
     }
 
     case OPT_incl:
-      ctx.addInitialUndefinedSymbol(ctx.allocateString(inputArg->getValue()));
+      ctx.addInitialUndefinedSymbol(ctx.allocate(inputArg->getValue()));
       break;
 
     case OPT_nodefaultlib_all:
@@ -846,12 +846,12 @@ WinLinkDriver::parse(int argc, const cha
       break;
 
     case OPT_out:
-      ctx.setOutputPath(ctx.allocateString(inputArg->getValue()));
+      ctx.setOutputPath(ctx.allocate(inputArg->getValue()));
       break;
 
     case OPT_INPUT:
       inputElements.push_back(std::unique_ptr<InputElement>(
-          new PECOFFFileNode(ctx, ctx.allocateString(inputArg->getValue()))));
+          new PECOFFFileNode(ctx, ctx.allocate(inputArg->getValue()))));
       break;
 
 #define DEFINE_BOOLEAN_FLAG(name, setter)       \
@@ -903,7 +903,7 @@ WinLinkDriver::parse(int argc, const cha
   if (llvm::opt::Arg *dashdash = parsedArgs->getLastArg(OPT_DASH_DASH)) {
     for (const StringRef value : dashdash->getValues()) {
       std::unique_ptr<InputElement> elem(
-          new PECOFFFileNode(ctx, ctx.allocateString(value)));
+          new PECOFFFileNode(ctx, ctx.allocate(value)));
       inputElements.push_back(std::move(elem));
     }
   }
@@ -938,7 +938,7 @@ WinLinkDriver::parse(int argc, const cha
   if (ctx.getManifestOutputPath().empty()) {
     std::string path = ctx.outputPath();
     path.append(".manifest");
-    ctx.setManifestOutputPath(ctx.allocateString(path));
+    ctx.setManifestOutputPath(ctx.allocate(path));
   }
 
   // If the core linker already started, we need to explicitly call parse() for

Modified: lld/trunk/lib/Driver/WinLinkInputGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/WinLinkInputGraph.cpp?rev=195284&r1=195283&r2=195284&view=diff
==============================================================================
--- lld/trunk/lib/Driver/WinLinkInputGraph.cpp (original)
+++ lld/trunk/lib/Driver/WinLinkInputGraph.cpp Wed Nov 20 18:17:31 2013
@@ -55,14 +55,14 @@ ErrorOr<StringRef> PECOFFFileNode::getPa
   if (_path.endswith_lower(".lib"))
     return _ctx.searchLibraryFile(_path);
   if (llvm::sys::path::extension(_path).empty())
-    return _ctx.allocateString(_path.str() + ".obj");
+    return _ctx.allocate(_path.str() + ".obj");
   return _path;
 }
 
 ErrorOr<StringRef> PECOFFLibraryNode::getPath(const LinkingContext &) const {
   if (_path.endswith_lower(".lib"))
     return _ctx.searchLibraryFile(_path);
-  return _ctx.searchLibraryFile(_ctx.allocateString(_path.str() + ".lib"));
+  return _ctx.searchLibraryFile(_ctx.allocate(_path.str() + ".lib"));
 }
 
 } // end anonymous namespace

Modified: lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp?rev=195284&r1=195283&r2=195284&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/PECOFFLinkingContext.cpp Wed Nov 20 18:17:31 2013
@@ -165,7 +165,7 @@ StringRef PECOFFLinkingContext::searchLi
     SmallString<128> path = dir;
     llvm::sys::path::append(path, filename);
     if (llvm::sys::fs::exists(path.str()))
-      return allocateString(path.str());
+      return allocate(path.str());
   }
   return filename;
 }





More information about the llvm-commits mailing list