aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-08-14 14:50:32 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-08-14 14:50:32 +0000
commit42c72c258e08ca79c9267346b4badcddd8fcd001 (patch)
treeb079c0b41e38b96d8bbd938c494d8f64faf3a5df
parent9071defafbcfb5d21bb6d49bb9c0f0366db39e08 (diff)
Do NOT use inline functions with LLVM_ATTRIBUTE_USED.
The function will be emitted into every single TU including the header! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161872 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/DeclBase.h4
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h2
-rw-r--r--lib/AST/DeclPrinter.cpp4
-rw-r--r--lib/AST/DumpXML.cpp5
-rw-r--r--lib/StaticAnalyzer/Core/CallEvent.cpp4
5 files changed, 16 insertions, 3 deletions
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h
index ac2cc9ec4d..0f596095f7 100644
--- a/include/clang/AST/DeclBase.h
+++ b/include/clang/AST/DeclBase.h
@@ -858,10 +858,10 @@ public:
raw_ostream &Out, const PrintingPolicy &Policy,
unsigned Indentation = 0);
// Debuggers don't usually respect default arguments.
- LLVM_ATTRIBUTE_USED void dump() const { dump(llvm::errs()); }
+ LLVM_ATTRIBUTE_USED void dump() const;
void dump(raw_ostream &Out) const;
// Debuggers don't usually respect default arguments.
- LLVM_ATTRIBUTE_USED void dumpXML() const { dumpXML(llvm::errs()); }
+ LLVM_ATTRIBUTE_USED void dumpXML() const;
void dumpXML(raw_ostream &OS) const;
private:
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h b/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
index 47edfe9fca..6e04ba6fe5 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
@@ -328,7 +328,7 @@ public:
// For debugging purposes only
void dump(raw_ostream &Out) const;
- LLVM_ATTRIBUTE_USED void dump() const { dump(llvm::errs()); }
+ LLVM_ATTRIBUTE_USED void dump() const;
static bool classof(const CallEvent *) { return true; }
};
diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp
index aad0ca1b53..8a53900d5d 100644
--- a/lib/AST/DeclPrinter.cpp
+++ b/lib/AST/DeclPrinter.cpp
@@ -175,6 +175,10 @@ void DeclContext::dumpDeclContext() const {
Printer.VisitDeclContext(const_cast<DeclContext *>(this), /*Indent=*/false);
}
+void Decl::dump() const {
+ dump(llvm::errs());
+}
+
void Decl::dump(raw_ostream &Out) const {
PrintingPolicy Policy = getASTContext().getPrintingPolicy();
Policy.Dump = true;
diff --git a/lib/AST/DumpXML.cpp b/lib/AST/DumpXML.cpp
index c1432b5720..84f3fc491c 100644
--- a/lib/AST/DumpXML.cpp
+++ b/lib/AST/DumpXML.cpp
@@ -1022,12 +1022,17 @@ struct XMLDumper : public XMLDeclVisitor<XMLDumper>,
};
}
+void Decl::dumpXML() const {
+ dump(llvm::errs());
+}
+
void Decl::dumpXML(raw_ostream &out) const {
XMLDumper(out, getASTContext()).dispatch(const_cast<Decl*>(this));
}
#else /* ifndef NDEBUG */
+void Decl::dumpXML() const {}
void Decl::dumpXML(raw_ostream &out) const {}
#endif
diff --git a/lib/StaticAnalyzer/Core/CallEvent.cpp b/lib/StaticAnalyzer/Core/CallEvent.cpp
index e3f4c61e90..496a7461cb 100644
--- a/lib/StaticAnalyzer/Core/CallEvent.cpp
+++ b/lib/StaticAnalyzer/Core/CallEvent.cpp
@@ -207,6 +207,10 @@ SourceRange CallEvent::getArgSourceRange(unsigned Index) const {
return ArgE->getSourceRange();
}
+void CallEvent::dump() const {
+ dump(llvm::errs());
+}
+
void CallEvent::dump(raw_ostream &Out) const {
ASTContext &Ctx = getState()->getStateManager().getContext();
if (const Expr *E = getOriginExpr()) {