diff options
author | Rui Ueyama <ruiu@google.com> | 2017-07-18 21:07:13 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2017-07-18 21:07:13 +0000 |
commit | 6db83a3af3603603b9d7e3e50b3d10c43aef278d (patch) | |
tree | 6e0e5e3d2f61107dd54a7bf9899948221def66c2 /llvm/lib/Object/COFFModuleDefinition.cpp | |
parent | 9b6e9899f2c9fbdd9a1f912c52ffe1ca6bc6c40f (diff) | |
download | bcm5719-llvm-6db83a3af3603603b9d7e3e50b3d10c43aef278d.tar.gz bcm5719-llvm-6db83a3af3603603b9d7e3e50b3d10c43aef278d.zip |
Revert r308329: llvm: add llvm-dlltool support to the archiver
This reverts commit r308329 because it broke buildbots.
llvm-svn: 308374
Diffstat (limited to 'llvm/lib/Object/COFFModuleDefinition.cpp')
-rw-r--r-- | llvm/lib/Object/COFFModuleDefinition.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/llvm/lib/Object/COFFModuleDefinition.cpp b/llvm/lib/Object/COFFModuleDefinition.cpp index d6729684e20..0d69cb6b709 100644 --- a/llvm/lib/Object/COFFModuleDefinition.cpp +++ b/llvm/lib/Object/COFFModuleDefinition.cpp @@ -55,10 +55,8 @@ struct Token { StringRef Value; }; -static bool isDecorated(StringRef Sym, bool MingwDef) { - // mingw does not prepend "_". - return (!MingwDef && Sym.startswith("_")) || Sym.startswith("@") || - Sym.startswith("?"); +static bool isDecorated(StringRef Sym) { + return Sym.startswith("_") || Sym.startswith("@") || Sym.startswith("?"); } static Error createError(const Twine &Err) { @@ -85,9 +83,6 @@ public: } case '=': Buf = Buf.drop_front(); - // GNU dlltool accepts both = and ==. - if (Buf.startswith("=")) - Buf = Buf.drop_front(); return Token(Equal, "="); case ',': Buf = Buf.drop_front(); @@ -125,8 +120,7 @@ private: class Parser { public: - explicit Parser(StringRef S, MachineTypes M, bool B) - : Lex(S), Machine(M), MingwDef(B) {} + explicit Parser(StringRef S, MachineTypes M) : Lex(S), Machine(M) {} Expected<COFFModuleDefinition> parse() { do { @@ -219,9 +213,9 @@ private: } if (Machine == IMAGE_FILE_MACHINE_I386) { - if (!isDecorated(E.Name, MingwDef)) + if (!isDecorated(E.Name)) E.Name = (std::string("_").append(E.Name)); - if (!E.ExtName.empty() && !isDecorated(E.ExtName, MingwDef)) + if (!E.ExtName.empty() && !isDecorated(E.ExtName)) E.ExtName = (std::string("_").append(E.ExtName)); } @@ -314,13 +308,11 @@ private: std::vector<Token> Stack; MachineTypes Machine; COFFModuleDefinition Info; - bool MingwDef; }; Expected<COFFModuleDefinition> parseCOFFModuleDefinition(MemoryBufferRef MB, - MachineTypes Machine, - bool MingwDef) { - return Parser(MB.getBuffer(), Machine, MingwDef).parse(); + MachineTypes Machine) { + return Parser(MB.getBuffer(), Machine).parse(); } } // namespace object |