<div dir="ltr">It's a always good practice to mention in the commit message why the previous commit was reverted when you revert a commit.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 10, 2014 at 4:40 PM, Shankar Easwaran <span dir="ltr"><<a href="mailto:shankare@codeaurora.org" target="_blank">shankare@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: shankare<br>
Date: Mon Nov 10 18:40:36 2014<br>
New Revision: 221649<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=221649&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=221649&view=rev</a><br>
Log:<br>
Revert "Add support library."<br>
<br>
This reverts commit r221583.<br>
<br>
Removed:<br>
lld/trunk/include/lld/Support/NumParse.h<br>
lld/trunk/lib/Support/CMakeLists.txt<br>
lld/trunk/lib/Support/NumParse.cpp<br>
Modified:<br>
lld/trunk/lib/CMakeLists.txt<br>
lld/trunk/lib/Makefile<br>
lld/trunk/lib/ReaderWriter/CMakeLists.txt<br>
lld/trunk/lib/ReaderWriter/LinkerScript.cpp<br>
lld/trunk/tools/lld/Makefile<br>
lld/trunk/unittests/DriverTests/Makefile<br>
lld/trunk/utils/linker-script-test/Makefile<br>
<br>
Removed: lld/trunk/include/lld/Support/NumParse.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Support/NumParse.h?rev=221648&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Support/NumParse.h?rev=221648&view=auto</a><br>
==============================================================================<br>
--- lld/trunk/include/lld/Support/NumParse.h (original)<br>
+++ lld/trunk/include/lld/Support/NumParse.h (removed)<br>
@@ -1,45 +0,0 @@<br>
-//===-- lld/Support/NumParse.h - Number parsing -----------------*- C++ -*-===//<br>
-//<br>
-// The LLVM Compiler Infrastructure<br>
-//<br>
-// This file is distributed under the University of Illinois Open Source<br>
-// License. See LICENSE.TXT for details.<br>
-//<br>
-//===----------------------------------------------------------------------===//<br>
-///<br>
-/// \file<br>
-/// \brief Parses string in various formats to decimal.<br>
-///<br>
-//===----------------------------------------------------------------------===//<br>
-<br>
-#ifndef LLD_SUPPORT_NUM_PARSE_H<br>
-#define LLD_SUPPORT_NUM_PARSE_H<br>
-<br>
-#include "lld/Core/LLVM.h"<br>
-#include "llvm/ADT/StringSwitch.h"<br>
-#include "llvm/Support/ErrorOr.h"<br>
-#include "llvm/Support/raw_ostream.h"<br>
-#include <memory><br>
-#include <system_error><br>
-#include <vector><br>
-<br>
-namespace lld {<br>
-<br>
-/// \brief Convert a string in decimal to decimal.<br>
-llvm::ErrorOr<uint64_t> parseDecimal(StringRef str);<br>
-<br>
-/// \brief Convert a string in octal to decimal.<br>
-llvm::ErrorOr<uint64_t> parseOctal(StringRef str);<br>
-<br>
-/// \brief Convert a string in Binary to decimal.<br>
-llvm::ErrorOr<uint64_t> parseBinary(StringRef str);<br>
-<br>
-/// \brief Convert a string in Hexadecimal to decimal.<br>
-llvm::ErrorOr<uint64_t> parseHex(StringRef str);<br>
-<br>
-/// \brief Parse a number represested in a string as<br>
-// Hexadecimal, Octal, Binary or Decimal to decimal<br>
-llvm::ErrorOr<uint64_t> parseNum(StringRef str, bool parseExtensions = true);<br>
-}<br>
-<br>
-#endif // LLD_SUPPORT_NUM_PARSE_H<br>
<br>
Modified: lld/trunk/lib/CMakeLists.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/CMakeLists.txt?rev=221649&r1=221648&r2=221649&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/CMakeLists.txt?rev=221649&r1=221648&r2=221649&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/CMakeLists.txt (original)<br>
+++ lld/trunk/lib/CMakeLists.txt Mon Nov 10 18:40:36 2014<br>
@@ -3,4 +3,3 @@ add_subdirectory(Core)<br>
add_subdirectory(Driver)<br>
add_subdirectory(Passes)<br>
add_subdirectory(ReaderWriter)<br>
-add_subdirectory(Support)<br>
<br>
Modified: lld/trunk/lib/Makefile<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Makefile?rev=221649&r1=221648&r2=221649&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Makefile?rev=221649&r1=221648&r2=221649&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/Makefile (original)<br>
+++ lld/trunk/lib/Makefile Mon Nov 10 18:40:36 2014<br>
@@ -9,7 +9,7 @@<br>
LLD_LEVEL := ..<br>
<br>
# ARCMigrate and Rewrite are always needed because of libclang.<br>
-PARALLEL_DIRS = Config Core Driver Passes ReaderWriter Support<br>
+PARALLEL_DIRS = Config Core Driver Passes ReaderWriter<br>
<br>
include $(LLD_LEVEL)/../../Makefile.config<br>
<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/CMakeLists.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/CMakeLists.txt?rev=221649&r1=221648&r2=221649&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/CMakeLists.txt?rev=221649&r1=221648&r2=221649&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/CMakeLists.txt (original)<br>
+++ lld/trunk/lib/ReaderWriter/CMakeLists.txt Mon Nov 10 18:40:36 2014<br>
@@ -18,5 +18,4 @@ add_lld_library(lldReaderWriter<br>
target_link_libraries(lldReaderWriter ${cmake_2_8_12_INTERFACE}<br>
lldCore<br>
lldPasses<br>
- lldSupport<br>
)<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/LinkerScript.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/LinkerScript.cpp?rev=221649&r1=221648&r2=221649&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/LinkerScript.cpp?rev=221649&r1=221648&r2=221649&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/LinkerScript.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/LinkerScript.cpp Mon Nov 10 18:40:36 2014<br>
@@ -13,7 +13,6 @@<br>
//===----------------------------------------------------------------------===//<br>
<br>
#include "lld/ReaderWriter/LinkerScript.h"<br>
-#include "lld/Support/NumParse.h"<br>
<br>
namespace lld {<br>
namespace script {<br>
@@ -90,7 +89,56 @@ void Token::dump(raw_ostream &os) const<br>
os << _range << "\n";<br>
}<br>
<br>
-bool parseHexToByteStream(StringRef str, std::string &buf) {<br>
+static llvm::ErrorOr<uint64_t> parseDecimal(StringRef str) {<br>
+ uint64_t res = 0;<br>
+ for (auto &c : str) {<br>
+ res *= 10;<br>
+ if (c < '0' || c > '9')<br>
+ return llvm::ErrorOr<uint64_t>(std::make_error_code(std::errc::io_error));<br>
+ res += c - '0';<br>
+ }<br>
+ return res;<br>
+}<br>
+<br>
+static llvm::ErrorOr<uint64_t> parseOctal(StringRef str) {<br>
+ uint64_t res = 0;<br>
+ for (auto &c : str) {<br>
+ res <<= 3;<br>
+ if (c < '0' || c > '7')<br>
+ return llvm::ErrorOr<uint64_t>(std::make_error_code(std::errc::io_error));<br>
+ res += c - '0';<br>
+ }<br>
+ return res;<br>
+}<br>
+<br>
+static llvm::ErrorOr<uint64_t> parseBinary(StringRef str) {<br>
+ uint64_t res = 0;<br>
+ for (auto &c : str) {<br>
+ res <<= 1;<br>
+ if (c != '0' && c != '1')<br>
+ return llvm::ErrorOr<uint64_t>(std::make_error_code(std::errc::io_error));<br>
+ res += c - '0';<br>
+ }<br>
+ return res;<br>
+}<br>
+<br>
+static llvm::ErrorOr<uint64_t> parseHex(StringRef str) {<br>
+ uint64_t res = 0;<br>
+ for (auto &c : str) {<br>
+ res <<= 4;<br>
+ if (c >= '0' && c <= '9')<br>
+ res += c - '0';<br>
+ else if (c >= 'a' && c <= 'f')<br>
+ res += c - 'a' + 10;<br>
+ else if (c >= 'A' && c <= 'F')<br>
+ res += c - 'A' + 10;<br>
+ else<br>
+ return llvm::ErrorOr<uint64_t>(std::make_error_code(std::errc::io_error));<br>
+ }<br>
+ return res;<br>
+}<br>
+<br>
+static bool parseHexToByteStream(StringRef str, std::string &buf) {<br>
unsigned char byte = 0;<br>
bool dumpByte = str.size() % 2;<br>
for (auto &c : str) {<br>
@@ -130,6 +178,63 @@ static void dumpByteStream(raw_ostream &<br>
}<br>
}<br>
<br>
+static llvm::ErrorOr<uint64_t> parseNum(StringRef str) {<br>
+ unsigned multiplier = 1;<br>
+ enum NumKind { decimal, hex, octal, binary };<br>
+ NumKind kind = llvm::StringSwitch<NumKind>(str)<br>
+ .StartsWith("0x", hex)<br>
+ .StartsWith("0X", hex)<br>
+ .StartsWith("0", octal)<br>
+ .Default(decimal);<br>
+<br>
+ // Parse scale<br>
+ if (str.endswith("K")) {<br>
+ multiplier = 1 << 10;<br>
+ str = str.drop_back();<br>
+ } else if (str.endswith("M")) {<br>
+ multiplier = 1 << 20;<br>
+ str = str.drop_back();<br>
+ }<br>
+<br>
+ // Parse type<br>
+ if (str.endswith_lower("o")) {<br>
+ kind = octal;<br>
+ str = str.drop_back();<br>
+ } else if (str.endswith_lower("h")) {<br>
+ kind = hex;<br>
+ str = str.drop_back();<br>
+ } else if (str.endswith_lower("d")) {<br>
+ kind = decimal;<br>
+ str = str.drop_back();<br>
+ } else if (str.endswith_lower("b")) {<br>
+ kind = binary;<br>
+ str = str.drop_back();<br>
+ }<br>
+<br>
+ llvm::ErrorOr<uint64_t> res(0);<br>
+ switch (kind) {<br>
+ case hex:<br>
+ if (str.startswith_lower("0x"))<br>
+ str = str.drop_front(2);<br>
+ res = parseHex(str);<br>
+ break;<br>
+ case octal:<br>
+ res = parseOctal(str);<br>
+ break;<br>
+ case decimal:<br>
+ res = parseDecimal(str);<br>
+ break;<br>
+ case binary:<br>
+ res = parseBinary(str);<br>
+ break;<br>
+ }<br>
+ if (res.getError())<br>
+ return res;<br>
+<br>
+ *res = *res * multiplier;<br>
+ return res;<br>
+}<br>
+<br>
bool Lexer::canStartNumber(char c) const {<br>
return '0' <= c && c <= '9';<br>
}<br>
<br>
Removed: lld/trunk/lib/Support/CMakeLists.txt<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Support/CMakeLists.txt?rev=221648&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Support/CMakeLists.txt?rev=221648&view=auto</a><br>
==============================================================================<br>
--- lld/trunk/lib/Support/CMakeLists.txt (original)<br>
+++ lld/trunk/lib/Support/CMakeLists.txt (removed)<br>
@@ -1,3 +0,0 @@<br>
-add_lld_library(lldSupport<br>
- NumParse.cpp<br>
- )<br>
<br>
Removed: lld/trunk/lib/Support/NumParse.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Support/NumParse.cpp?rev=221648&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Support/NumParse.cpp?rev=221648&view=auto</a><br>
==============================================================================<br>
--- lld/trunk/lib/Support/NumParse.cpp (original)<br>
+++ lld/trunk/lib/Support/NumParse.cpp (removed)<br>
@@ -1,133 +0,0 @@<br>
-//===-- lld/Support/NumParse.cpp - Number parsing ---------------*- C++ -*-===//<br>
-//<br>
-// The LLVM Compiler Infrastructure<br>
-//<br>
-// This file is distributed under the University of Illinois Open Source<br>
-// License. See LICENSE.TXT for details.<br>
-//<br>
-//===----------------------------------------------------------------------===//<br>
-///<br>
-/// \file<br>
-/// \brief Parses string in various formats to decimal.<br>
-///<br>
-//===----------------------------------------------------------------------===//<br>
-<br>
-#include "lld/Support/NumParse.h"<br>
-<br>
-using namespace llvm;<br>
-<br>
-namespace lld {<br>
-/// \brief Convert a string in decimal to decimal.<br>
-llvm::ErrorOr<uint64_t> parseDecimal(StringRef str) {<br>
- uint64_t res = 0;<br>
- for (auto &c : str) {<br>
- res *= 10;<br>
- if (c < '0' || c > '9')<br>
- return llvm::ErrorOr<uint64_t>(std::make_error_code(std::errc::io_error));<br>
- res += c - '0';<br>
- }<br>
- return res;<br>
-}<br>
-<br>
-/// \brief Convert a string in octal to decimal.<br>
-llvm::ErrorOr<uint64_t> parseOctal(StringRef str) {<br>
- uint64_t res = 0;<br>
- for (auto &c : str) {<br>
- res <<= 3;<br>
- if (c < '0' || c > '7')<br>
- return llvm::ErrorOr<uint64_t>(std::make_error_code(std::errc::io_error));<br>
- res += c - '0';<br>
- }<br>
- return res;<br>
-}<br>
-<br>
-/// \brief Convert a string in Binary to decimal.<br>
-llvm::ErrorOr<uint64_t> parseBinary(StringRef str) {<br>
- uint64_t res = 0;<br>
- for (auto &c : str) {<br>
- res <<= 1;<br>
- if (c != '0' && c != '1')<br>
- return llvm::ErrorOr<uint64_t>(std::make_error_code(std::errc::io_error));<br>
- res += c - '0';<br>
- }<br>
- return res;<br>
-}<br>
-<br>
-/// \brief Convert a string in Hexadecimal to decimal.<br>
-llvm::ErrorOr<uint64_t> parseHex(StringRef str) {<br>
- uint64_t res = 0;<br>
- for (auto &c : str) {<br>
- res <<= 4;<br>
- if (c >= '0' && c <= '9')<br>
- res += c - '0';<br>
- else if (c >= 'a' && c <= 'f')<br>
- res += c - 'a' + 10;<br>
- else if (c >= 'A' && c <= 'F')<br>
- res += c - 'A' + 10;<br>
- else<br>
- return llvm::ErrorOr<uint64_t>(std::make_error_code(std::errc::io_error));<br>
- }<br>
- return res;<br>
-}<br>
-<br>
-/// \brief Parse a number represested in a string as<br>
-// Hexadecimal, Octal, Binary or Decimal to decimal<br>
-llvm::ErrorOr<uint64_t> parseNum(StringRef str, bool parseExtensions) {<br>
- unsigned multiplier = 1;<br>
- enum NumKind { decimal, hex, octal, binary };<br>
- NumKind kind = llvm::StringSwitch<NumKind>(str)<br>
- .StartsWith("0x", hex)<br>
- .StartsWith("0X", hex)<br>
- .StartsWith("0", octal)<br>
- .Default(decimal);<br>
-<br>
- if (parseExtensions) {<br>
- // Parse scale<br>
- if (str.endswith("K")) {<br>
- multiplier = 1 << 10;<br>
- str = str.drop_back();<br>
- } else if (str.endswith("M")) {<br>
- multiplier = 1 << 20;<br>
- str = str.drop_back();<br>
- }<br>
-<br>
- // Parse type<br>
- if (str.endswith_lower("o")) {<br>
- kind = octal;<br>
- str = str.drop_back();<br>
- } else if (str.endswith_lower("h")) {<br>
- kind = hex;<br>
- str = str.drop_back();<br>
- } else if (str.endswith_lower("d")) {<br>
- kind = decimal;<br>
- str = str.drop_back();<br>
- } else if (str.endswith_lower("b")) {<br>
- kind = binary;<br>
- str = str.drop_back();<br>
- }<br>
- }<br>
-<br>
- llvm::ErrorOr<uint64_t> res(0);<br>
- switch (kind) {<br>
- case hex:<br>
- if (str.startswith_lower("0x"))<br>
- str = str.drop_front(2);<br>
- res = parseHex(str);<br>
- break;<br>
- case octal:<br>
- res = parseOctal(str);<br>
- break;<br>
- case decimal:<br>
- res = parseDecimal(str);<br>
- break;<br>
- case binary:<br>
- res = parseBinary(str);<br>
- break;<br>
- }<br>
- if (res.getError())<br>
- return res;<br>
-<br>
- *res = *res * multiplier;<br>
- return res;<br>
-}<br>
-}<br>
<br>
Modified: lld/trunk/tools/lld/Makefile<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/tools/lld/Makefile?rev=221649&r1=221648&r2=221649&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/tools/lld/Makefile?rev=221649&r1=221648&r2=221649&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/tools/lld/Makefile (original)<br>
+++ lld/trunk/tools/lld/Makefile Mon Nov 10 18:40:36 2014<br>
@@ -19,9 +19,9 @@ LEVEL := $(LLD_LEVEL)/../..<br>
include $(LEVEL)/Makefile.config<br>
<br>
LINK_COMPONENTS := $(TARGETS_TO_BUILD)<br>
-USEDLIBS = lldDriver.a lldConfig.a lldSupport.a \<br>
+USEDLIBS = lldDriver.a lldConfig.a \<br>
lldELF.a lldMachO.a lldPasses.a lldPECOFF.a lldYAML.a \<br>
- lldReaderWriter.a lldCore.a lldSupport.a lldNative.a \<br>
+ lldReaderWriter.a lldCore.a lldNative.a \<br>
lldHexagonELFTarget.a lldPPCELFTarget.a lldMipsELFTarget.a \<br>
lldX86ELFTarget.a lldX86_64ELFTarget.a lldAArch64ELFTarget.a \<br>
LLVMOption.a<br>
<br>
Modified: lld/trunk/unittests/DriverTests/Makefile<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/unittests/DriverTests/Makefile?rev=221649&r1=221648&r2=221649&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/unittests/DriverTests/Makefile?rev=221649&r1=221648&r2=221649&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/unittests/DriverTests/Makefile (original)<br>
+++ lld/trunk/unittests/DriverTests/Makefile Mon Nov 10 18:40:36 2014<br>
@@ -15,7 +15,5 @@ USEDLIBS = lldDriver.a lldConfig.a \<br>
lldHexagonELFTarget.a lldPPCELFTarget.a lldMipsELFTarget.a \<br>
lldX86ELFTarget.a lldX86_64ELFTarget.a lldYAML.a \<br>
LLVMObject.a LLVMMCParser.a LLVMMC.a LLVMBitReader.a \<br>
- LLVMCore.a LLVMOption.a LLVMSupport.a lldAArch64ELFTarget.a \<br>
- lldSupport.a<br>
-<br>
+ LLVMCore.a LLVMOption.a LLVMSupport.a lldAArch64ELFTarget.a<br>
include $(LLD_LEVEL)/unittests/Makefile<br>
<br>
Modified: lld/trunk/utils/linker-script-test/Makefile<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/utils/linker-script-test/Makefile?rev=221649&r1=221648&r2=221649&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/utils/linker-script-test/Makefile?rev=221649&r1=221648&r2=221649&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/utils/linker-script-test/Makefile (original)<br>
+++ lld/trunk/utils/linker-script-test/Makefile Mon Nov 10 18:40:36 2014<br>
@@ -19,6 +19,6 @@ LEVEL := $(LLD_LEVEL)/../..<br>
include $(LEVEL)/Makefile.config<br>
<br>
LINK_COMPONENTS := $(TARGETS_TO_BUILD)<br>
-USEDLIBS = lldReaderWriter.a lldSupport.a LLVMSupport.a<br>
+USEDLIBS = lldReaderWriter.a LLVMSupport.a<br>
<br>
include $(LLD_LEVEL)/Makefile<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>