From: Eric Fiselier Date: Sun, 30 Sep 2018 18:05:39 +0000 (+0000) Subject: Fix linkage error on ProgramPoint's dump method. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bdf4477271fb76aee983620359b32b0abf90c77f;p=clang Fix linkage error on ProgramPoint's dump method. Currently, ProgramPoint::dump calls the out-of-line function ProgramPoint::print. This causes libraries which include ProgramPoint.h to become dependent on libclangAnalysis, which in turn causes missing symbol link error when building with -DBUILD_SHARED_LIBS=ON -DLLVM_ENABLE_MODULES=ON. The breakage was introduced in r343160. This patch fixes the issues by moving ProgramPoint::dump's declaration out of line. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343420 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Analysis/ProgramPoint.h b/include/clang/Analysis/ProgramPoint.h index 35fedfd05a..d78174ecd7 100644 --- a/include/clang/Analysis/ProgramPoint.h +++ b/include/clang/Analysis/ProgramPoint.h @@ -217,9 +217,7 @@ public: void print(StringRef CR, llvm::raw_ostream &Out) const; - LLVM_DUMP_METHOD void dump() const { - return print(/*CR=*/"\n", llvm::errs()); - } + LLVM_DUMP_METHOD void dump() const; static ProgramPoint getProgramPoint(const Stmt *S, ProgramPoint::Kind K, const LocationContext *LC, diff --git a/lib/Analysis/ProgramPoint.cpp b/lib/Analysis/ProgramPoint.cpp index 9a04cb4152..2d016cb133 100644 --- a/lib/Analysis/ProgramPoint.cpp +++ b/lib/Analysis/ProgramPoint.cpp @@ -43,6 +43,10 @@ ProgramPoint ProgramPoint::getProgramPoint(const Stmt *S, ProgramPoint::Kind K, } } +LLVM_DUMP_METHOD void ProgramPoint::dump() const { + return print(/*CR=*/"\n", llvm::errs()); +} + static void printLocation(raw_ostream &Out, SourceLocation SLoc, const SourceManager &SM, StringRef CR,