[llvm] r264884 - Restore "[ThinLTO] Serialize the Module SourceFileName to/from LLVM assembly"

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 30 13:52:24 PDT 2016


>
> Modified: llvm/trunk/lib/IR/AsmWriter.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.cpp?rev=264884&r1=264883&r2=264884&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/IR/AsmWriter.cpp (original)
> +++ llvm/trunk/lib/IR/AsmWriter.cpp Wed Mar 30 13:15:08 2016
> @@ -2203,6 +2203,22 @@ void AssemblyWriter::writeOperandBundles
>    Out << " ]";
>  }
>
> +/// Escape any backslashes in the source file (e.g. Windows paths)
> +/// before emitting, so that it is parsed properly by the lexer on input.
> +static void EscapeBackslashes(std::string Str,
> +                              SmallVectorImpl<char> &Res) {
> +  for (auto C : Str) {
> +    switch (C) {
> +    default:
> +      break;
> +    case '\\':
> +      Res.push_back('\\');
> +      break;
> +    }
> +    Res.push_back(C);
> +  }
> +}
> +
>

Missed the fact that there is already a mechanism for escaping strings in
this file, removing this and will use the existing helper as soon as tests
finish running.

-- 
Teresa Johnson |  Software Engineer |  tejohnson at google.com |  408-460-2413
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160330/66d730dd/attachment.html>


More information about the llvm-commits mailing list