From: Teresa Johnson Date: Wed, 30 Mar 2016 15:16:04 +0000 (+0000) Subject: Revert "[ThinLTO] Serialize the Module SourceFileName to/from LLVM assembly" X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=20beeea24a6a11cac6e59dee8250b72fe24b6871;p=platform%2Fupstream%2Fllvm.git Revert "[ThinLTO] Serialize the Module SourceFileName to/from LLVM assembly" This reverts commit r264869. I am seeing Windows bot failures due to the "\" in the path being mishandled at some point (seems to be interpreted wrongly at some point and llvm-as | llvm-dis is yielding some junk characters). Need to investigate. llvm-svn: 264871 --- diff --git a/llvm/lib/AsmParser/LLLexer.cpp b/llvm/lib/AsmParser/LLLexer.cpp index 46ffc64..d238513 100644 --- a/llvm/lib/AsmParser/LLLexer.cpp +++ b/llvm/lib/AsmParser/LLLexer.cpp @@ -533,7 +533,6 @@ lltok::Kind LLLexer::LexIdentifier() { KEYWORD(notail); KEYWORD(target); KEYWORD(triple); - KEYWORD(source_filename); KEYWORD(unwind); KEYWORD(deplibs); // FIXME: Remove in 4.0. KEYWORD(datalayout); diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 39c6135..76bd99e 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -239,10 +239,6 @@ bool LLParser::ParseTopLevelEntities() { case lltok::kw_define: if (ParseDefine()) return true; break; case lltok::kw_module: if (ParseModuleAsm()) return true; break; case lltok::kw_target: if (ParseTargetDefinition()) return true; break; - case lltok::kw_source_filename: - if (ParseSourceFileName()) - return true; - break; case lltok::kw_deplibs: if (ParseDepLibs()) return true; break; case lltok::LocalVarID: if (ParseUnnamedType()) return true; break; case lltok::LocalVar: if (ParseNamedType()) return true; break; @@ -340,19 +336,6 @@ bool LLParser::ParseTargetDefinition() { } /// toplevelentity -/// ::= 'source_filename' '=' STRINGCONSTANT -bool LLParser::ParseSourceFileName() { - assert(Lex.getKind() == lltok::kw_source_filename); - std::string Str; - Lex.Lex(); - if (ParseToken(lltok::equal, "expected '=' after source_filename") || - ParseStringConstant(Str)) - return true; - M->setSourceFileName(Str); - return false; -} - -/// toplevelentity /// ::= 'deplibs' '=' '[' ']' /// ::= 'deplibs' '=' '[' STRINGCONSTANT (',' STRINGCONSTANT)* ']' /// FIXME: Remove in 4.0. Currently parse, but ignore. diff --git a/llvm/lib/AsmParser/LLParser.h b/llvm/lib/AsmParser/LLParser.h index fcece62..96f864a 100644 --- a/llvm/lib/AsmParser/LLParser.h +++ b/llvm/lib/AsmParser/LLParser.h @@ -261,7 +261,6 @@ namespace llvm { bool ValidateEndOfModule(); bool ParseTargetDefinition(); bool ParseModuleAsm(); - bool ParseSourceFileName(); bool ParseDepLibs(); // FIXME: Remove in 4.0. bool ParseUnnamedType(); bool ParseNamedType(); diff --git a/llvm/lib/AsmParser/LLToken.h b/llvm/lib/AsmParser/LLToken.h index c5a7490..f06b5b8 100644 --- a/llvm/lib/AsmParser/LLToken.h +++ b/llvm/lib/AsmParser/LLToken.h @@ -59,7 +59,6 @@ namespace lltok { kw_notail, kw_target, kw_triple, - kw_source_filename, kw_unwind, kw_deplibs, // FIXME: Remove in 4.0 kw_datalayout, diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index 3051193..ab56f080 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -2215,9 +2215,6 @@ void AssemblyWriter::printModule(const Module *M) { M->getModuleIdentifier().find('\n') == std::string::npos) Out << "; ModuleID = '" << M->getModuleIdentifier() << "'\n"; - if (!M->getSourceFileName().empty()) - Out << "source_filename = \"" << M->getSourceFileName() << "\"\n"; - const std::string &DL = M->getDataLayoutStr(); if (!DL.empty()) Out << "target datalayout = \"" << DL << "\"\n"; diff --git a/llvm/test/Assembler/source-filename.ll b/llvm/test/Assembler/source-filename.ll deleted file mode 100644 index 11284fa..0000000 --- a/llvm/test/Assembler/source-filename.ll +++ /dev/null @@ -1,8 +0,0 @@ - -; Make sure that llvm-as/llvm-dis properly assemble/disassemble the -; source_filename. - -; RUN: llvm-as < %s | llvm-dis | FileCheck %s - -; CHECK: source_filename = "test.cc" -source_filename = "test.cc"