[cfe-commits] r167629 - in /cfe/trunk: include/clang/Basic/SourceLocation.h lib/Basic/SourceLocation.cpp

Chad Rosier mcrosier at apple.com
Fri Nov 9 11:53:48 PST 2012


Argyrios,
I believe this commit is causing the build to fail.  Let  me know if you need help reproducing the problem.

 Chad

On Nov 9, 2012, at 11:40 AM, Argyrios Kyrtzidis <akyrtzi at gmail.com> wrote:

> Author: akirtzidis
> Date: Fri Nov  9 13:40:48 2012
> New Revision: 167629
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=167629&view=rev
> Log:
> Add a SourceLocation::printToString() that returns in a std::string what dump()
> writes to stderr; for debugging purposes.
> 
> Modified:
>    cfe/trunk/include/clang/Basic/SourceLocation.h
>    cfe/trunk/lib/Basic/SourceLocation.cpp
> 
> Modified: cfe/trunk/include/clang/Basic/SourceLocation.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceLocation.h?rev=167629&r1=167628&r2=167629&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Basic/SourceLocation.h (original)
> +++ cfe/trunk/include/clang/Basic/SourceLocation.h Fri Nov  9 13:40:48 2012
> @@ -171,6 +171,7 @@
>   }
> 
>   void print(raw_ostream &OS, const SourceManager &SM) const;
> +  LLVM_ATTRIBUTE_USED std::string printToString(const SourceManager &SM) const;
>   void dump(const SourceManager &SM) const;
> };
> 
> 
> Modified: cfe/trunk/lib/Basic/SourceLocation.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceLocation.cpp?rev=167629&r1=167628&r2=167629&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Basic/SourceLocation.cpp (original)
> +++ cfe/trunk/lib/Basic/SourceLocation.cpp Fri Nov  9 13:40:48 2012
> @@ -61,6 +61,13 @@
>   OS << '>';
> }
> 
> +std::string SourceLocation::printToString(const SourceManager &SM) const {
> +  std::string S;
> +  llvm::raw_string_ostream OS(S);
> +  print(OS, SM);
> +  return S;
> +}
> +
> void SourceLocation::dump(const SourceManager &SM) const {
>   print(llvm::errs(), SM);
> }
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list