]> granicus.if.org Git - clang/commitdiff
No need to put the SourceManager in with the ASTContext, as the ASTContext
authorManuel Klimek <klimek@google.com>
Fri, 20 Apr 2012 14:07:01 +0000 (14:07 +0000)
committerManuel Klimek <klimek@google.com>
Fri, 20 Apr 2012 14:07:01 +0000 (14:07 +0000)
already contains the SourceManager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155198 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Tooling/RecursiveASTVisitorTest.cpp

index d749f76a22bc16f29993feb10e9ee7f024a29765..d7dad2738a05e3539b469b893cc80b545b5a66c5 100644 (file)
@@ -38,7 +38,6 @@ public:
 
 protected:
   clang::ASTContext *Context;
-  clang::SourceManager *SM;
 
 private:
   class FindConsumer : public clang::ASTConsumer {
@@ -59,7 +58,6 @@ private:
 
     virtual clang::ASTConsumer* CreateASTConsumer(
         clang::CompilerInstance& compiler, llvm::StringRef dummy) {
-      Visitor->SM = &compiler.getSourceManager();
       Visitor->Context = &compiler.getASTContext();
       /// TestConsumer will be deleted by the framework calling us.
       return new FindConsumer(Visitor);
@@ -116,7 +114,7 @@ protected:
       // If we did not match, record information about partial matches.
       llvm::raw_string_ostream Stream(PartialMatches);
       Stream << ", partial match: \"" << Name << "\" at ";
-      Location.print(Stream, *this->SM);
+      Location.print(Stream, this->Context->getSourceManager());
     }
   }