diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
commit | 13cc256e404620c1de0cbcc4e43ce1e2dbbc4898 (patch) | |
tree | 2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /lib/Basic/SourceLocation.cpp | |
parent | 657bc3d9848e3be92029b2416031340988cd0111 (diff) |
Notes
Diffstat (limited to 'lib/Basic/SourceLocation.cpp')
-rw-r--r-- | lib/Basic/SourceLocation.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Basic/SourceLocation.cpp b/lib/Basic/SourceLocation.cpp index bb5a10a9c7e40..0d62f7bb4b8c6 100644 --- a/lib/Basic/SourceLocation.cpp +++ b/lib/Basic/SourceLocation.cpp @@ -61,6 +61,13 @@ void SourceLocation::print(raw_ostream &OS, const SourceManager &SM)const{ 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); } |