[llvm-commits] [llvm] r163344 - in /llvm/trunk/lib: Analysis/ Analysis/IPA/ MC/ MC/MCParser/ Transforms/Scalar/ Transforms/Utils/
Duncan Sands
baldrick at free.fr
Fri Sep 7 04:09:31 PDT 2012
Hi Manman, same comment as on the other half of this patch: this makes it
harder to debug release builds because you can no longer call dump methods
from the debugger.
Ciao, Duncan.
On 06/09/12 21:55, Manman Ren wrote:
> Author: mren
> Date: Thu Sep 6 14:55:56 2012
> New Revision: 163344
>
> URL: http://llvm.org/viewvc/llvm-project?rev=163344&view=rev
> Log:
> Release build: guard dump functions with "ifndef NDEBUG"
>
> No functional change.
>
> Modified:
> llvm/trunk/lib/Analysis/AliasSetTracker.cpp
> llvm/trunk/lib/Analysis/DominanceFrontier.cpp
> llvm/trunk/lib/Analysis/IPA/CallGraph.cpp
> llvm/trunk/lib/Analysis/IVUsers.cpp
> llvm/trunk/lib/Analysis/InlineCost.cpp
> llvm/trunk/lib/Analysis/LoopInfo.cpp
> llvm/trunk/lib/Analysis/PHITransAddr.cpp
> llvm/trunk/lib/Analysis/RegionInfo.cpp
> llvm/trunk/lib/Analysis/ScalarEvolution.cpp
> llvm/trunk/lib/Analysis/Trace.cpp
> llvm/trunk/lib/MC/MCAssembler.cpp
> llvm/trunk/lib/MC/MCDwarf.cpp
> llvm/trunk/lib/MC/MCExpr.cpp
> llvm/trunk/lib/MC/MCInst.cpp
> llvm/trunk/lib/MC/MCLabel.cpp
> llvm/trunk/lib/MC/MCParser/MCAsmParser.cpp
> llvm/trunk/lib/MC/MCSymbol.cpp
> llvm/trunk/lib/MC/MCValue.cpp
> llvm/trunk/lib/MC/SubtargetFeature.cpp
> llvm/trunk/lib/Transforms/Scalar/GVN.cpp
> llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
> llvm/trunk/lib/Transforms/Utils/AddrModeMatcher.cpp
>
> Modified: llvm/trunk/lib/Analysis/AliasSetTracker.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/AliasSetTracker.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Analysis/AliasSetTracker.cpp (original)
> +++ llvm/trunk/lib/Analysis/AliasSetTracker.cpp Thu Sep 6 14:55:56 2012
> @@ -590,8 +590,10 @@
> OS << "\n";
> }
>
> +#ifndef NDEBUG
> void AliasSet::dump() const { print(dbgs()); }
> void AliasSetTracker::dump() const { print(dbgs()); }
> +#endif
>
> //===----------------------------------------------------------------------===//
> // ASTCallbackVH Class Implementation
>
> Modified: llvm/trunk/lib/Analysis/DominanceFrontier.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DominanceFrontier.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Analysis/DominanceFrontier.cpp (original)
> +++ llvm/trunk/lib/Analysis/DominanceFrontier.cpp Thu Sep 6 14:55:56 2012
> @@ -133,7 +133,9 @@
> }
> }
>
> +#ifndef NDEBUG
> void DominanceFrontierBase::dump() const {
> print(dbgs());
> }
> +#endif
>
>
> Modified: llvm/trunk/lib/Analysis/IPA/CallGraph.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/CallGraph.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Analysis/IPA/CallGraph.cpp (original)
> +++ llvm/trunk/lib/Analysis/IPA/CallGraph.cpp Thu Sep 6 14:55:56 2012
> @@ -198,9 +198,11 @@
> for (CallGraph::const_iterator I = begin(), E = end(); I != E; ++I)
> I->second->print(OS);
> }
> +#ifndef NDEBUG
> void CallGraph::dump() const {
> print(dbgs(), 0);
> }
> +#endif
>
> //===----------------------------------------------------------------------===//
> // Implementations of public modification methods
> @@ -267,7 +269,9 @@
> OS << '\n';
> }
>
> +#ifndef NDEBUG
> void CallGraphNode::dump() const { print(dbgs()); }
> +#endif
>
> /// removeCallEdgeFor - This method removes the edge in the node for the
> /// specified call site. Note that this method takes linear time, so it
>
> Modified: llvm/trunk/lib/Analysis/IVUsers.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IVUsers.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Analysis/IVUsers.cpp (original)
> +++ llvm/trunk/lib/Analysis/IVUsers.cpp Thu Sep 6 14:55:56 2012
> @@ -273,9 +273,11 @@
> }
> }
>
> +#ifndef NDEBUG
> void IVUsers::dump() const {
> print(dbgs());
> }
> +#endif
>
> void IVUsers::releaseMemory() {
> Processed.clear();
>
> Modified: llvm/trunk/lib/Analysis/InlineCost.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InlineCost.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Analysis/InlineCost.cpp (original)
> +++ llvm/trunk/lib/Analysis/InlineCost.cpp Thu Sep 6 14:55:56 2012
> @@ -974,6 +974,7 @@
> return AlwaysInline || Cost < Threshold;
> }
>
> +#ifndef NDEBUG
> /// \brief Dump stats about this call's analysis.
> void CallAnalyzer::dump() {
> #define DEBUG_PRINT_STAT(x) llvm::dbgs() << " " #x ": " << x << "\n"
> @@ -987,6 +988,7 @@
> DEBUG_PRINT_STAT(SROACostSavingsLost);
> #undef DEBUG_PRINT_STAT
> }
> +#endif
>
> InlineCost InlineCostAnalyzer::getInlineCost(CallSite CS, int Threshold) {
> return getInlineCost(CS, CS.getCalledFunction(), Threshold);
>
> Modified: llvm/trunk/lib/Analysis/LoopInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopInfo.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Analysis/LoopInfo.cpp (original)
> +++ llvm/trunk/lib/Analysis/LoopInfo.cpp Thu Sep 6 14:55:56 2012
> @@ -306,9 +306,11 @@
> return 0;
> }
>
> +#ifndef NDEBUG
> void Loop::dump() const {
> print(dbgs());
> }
> +#endif
>
> //===----------------------------------------------------------------------===//
> // UnloopUpdater implementation
>
> Modified: llvm/trunk/lib/Analysis/PHITransAddr.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/PHITransAddr.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Analysis/PHITransAddr.cpp (original)
> +++ llvm/trunk/lib/Analysis/PHITransAddr.cpp Thu Sep 6 14:55:56 2012
> @@ -41,6 +41,7 @@
> return false;
> }
>
> +#ifndef NDEBUG
> void PHITransAddr::dump() const {
> if (Addr == 0) {
> dbgs() << "PHITransAddr: null\n";
> @@ -50,6 +51,7 @@
> for (unsigned i = 0, e = InstInputs.size(); i != e; ++i)
> dbgs() << " Input #" << i << " is " << *InstInputs[i] << "\n";
> }
> +#endif
>
>
> static bool VerifySubExpr(Value *Expr,
>
> Modified: llvm/trunk/lib/Analysis/RegionInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionInfo.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Analysis/RegionInfo.cpp (original)
> +++ llvm/trunk/lib/Analysis/RegionInfo.cpp Thu Sep 6 14:55:56 2012
> @@ -427,9 +427,11 @@
> OS.indent(level*2) << "} \n";
> }
>
> +#ifndef NDEBUG
> void Region::dump() const {
> print(dbgs(), true, getDepth(), printStyle.getValue());
> }
> +#endif
>
> void Region::clearNodeCache() {
> // Free the cached nodes.
>
> Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
> +++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Thu Sep 6 14:55:56 2012
> @@ -122,10 +122,12 @@
> // Implementation of the SCEV class.
> //
>
> +#ifndef NDEBUG
> void SCEV::dump() const {
> print(dbgs());
> dbgs() << '\n';
> }
> +#endif
>
> void SCEV::print(raw_ostream &OS) const {
> switch (getSCEVType()) {
>
> Modified: llvm/trunk/lib/Analysis/Trace.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/Trace.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Analysis/Trace.cpp (original)
> +++ llvm/trunk/lib/Analysis/Trace.cpp Thu Sep 6 14:55:56 2012
> @@ -43,9 +43,11 @@
> O << "; Trace parent function: \n" << *F;
> }
>
> +#ifndef NDEBUG
> /// dump - Debugger convenience method; writes trace to standard error
> /// output stream.
> ///
> void Trace::dump() const {
> print(dbgs());
> }
> +#endif
>
> Modified: llvm/trunk/lib/MC/MCAssembler.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCAssembler.cpp (original)
> +++ llvm/trunk/lib/MC/MCAssembler.cpp Thu Sep 6 14:55:56 2012
> @@ -830,6 +830,7 @@
>
> }
>
> +#ifndef NDEBUG
> void MCFragment::dump() {
> raw_ostream &OS = llvm::errs();
>
> @@ -970,6 +971,7 @@
> }
> OS << "]>\n";
> }
> +#endif
>
> // anchors for MC*Fragment vtables
> void MCDataFragment::anchor() { }
>
> Modified: llvm/trunk/lib/MC/MCDwarf.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCDwarf.cpp (original)
> +++ llvm/trunk/lib/MC/MCDwarf.cpp Thu Sep 6 14:55:56 2012
> @@ -425,9 +425,11 @@
> OS << '"' << getName() << '"';
> }
>
> +#ifndef NDEBUG
> void MCDwarfFile::dump() const {
> print(dbgs());
> }
> +#endif
>
> // Utility function to write a tuple for .debug_abbrev.
> static void EmitAbbrev(MCStreamer *MCOS, uint64_t Name, uint64_t Form) {
>
> Modified: llvm/trunk/lib/MC/MCExpr.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCExpr.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCExpr.cpp (original)
> +++ llvm/trunk/lib/MC/MCExpr.cpp Thu Sep 6 14:55:56 2012
> @@ -136,10 +136,12 @@
> llvm_unreachable("Invalid expression kind!");
> }
>
> +#ifndef NDEBUG
> void MCExpr::dump() const {
> print(dbgs());
> dbgs() << '\n';
> }
> +#endif
>
> /* *** */
>
>
> Modified: llvm/trunk/lib/MC/MCInst.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCInst.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCInst.cpp (original)
> +++ llvm/trunk/lib/MC/MCInst.cpp Thu Sep 6 14:55:56 2012
> @@ -32,10 +32,12 @@
> OS << ">";
> }
>
> +#ifndef NDEBUG
> void MCOperand::dump() const {
> print(dbgs(), 0);
> dbgs() << "\n";
> }
> +#endif
>
> void MCInst::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
> OS << "<MCInst " << getOpcode();
> @@ -62,7 +64,9 @@
> OS << ">";
> }
>
> +#ifndef NDEBUG
> void MCInst::dump() const {
> print(dbgs(), 0);
> dbgs() << "\n";
> }
> +#endif
>
> Modified: llvm/trunk/lib/MC/MCLabel.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCLabel.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCLabel.cpp (original)
> +++ llvm/trunk/lib/MC/MCLabel.cpp Thu Sep 6 14:55:56 2012
> @@ -16,6 +16,8 @@
> OS << '"' << getInstance() << '"';
> }
>
> +#ifndef NDEBUG
> void MCLabel::dump() const {
> print(dbgs());
> }
> +#endif
>
> Modified: llvm/trunk/lib/MC/MCParser/MCAsmParser.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/MCAsmParser.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCParser/MCAsmParser.cpp (original)
> +++ llvm/trunk/lib/MC/MCParser/MCAsmParser.cpp Thu Sep 6 14:55:56 2012
> @@ -44,5 +44,7 @@
> }
>
> void MCParsedAsmOperand::dump() const {
> +#ifndef NDEBUG
> dbgs() << " " << *this;
> +#endif
> }
>
> Modified: llvm/trunk/lib/MC/MCSymbol.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCSymbol.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCSymbol.cpp (original)
> +++ llvm/trunk/lib/MC/MCSymbol.cpp Thu Sep 6 14:55:56 2012
> @@ -76,6 +76,8 @@
> OS << '"' << getName() << '"';
> }
>
> +#ifndef NDEBUG
> void MCSymbol::dump() const {
> print(dbgs());
> }
> +#endif
>
> Modified: llvm/trunk/lib/MC/MCValue.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCValue.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCValue.cpp (original)
> +++ llvm/trunk/lib/MC/MCValue.cpp Thu Sep 6 14:55:56 2012
> @@ -31,6 +31,8 @@
> OS << " + " << getConstant();
> }
>
> +#ifndef NDEBUG
> void MCValue::dump() const {
> print(dbgs(), 0);
> }
> +#endif
>
> Modified: llvm/trunk/lib/MC/SubtargetFeature.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/SubtargetFeature.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/SubtargetFeature.cpp (original)
> +++ llvm/trunk/lib/MC/SubtargetFeature.cpp Thu Sep 6 14:55:56 2012
> @@ -368,11 +368,13 @@
> OS << "\n";
> }
>
> +#ifndef NDEBUG
> /// dump - Dump feature info.
> ///
> void SubtargetFeatures::dump() const {
> print(dbgs());
> }
> +#endif
>
> /// getDefaultSubtargetFeatures - Return a string listing the features
> /// associated with the target triple.
>
> Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Thu Sep 6 14:55:56 2012
> @@ -632,6 +632,7 @@
> INITIALIZE_AG_DEPENDENCY(AliasAnalysis)
> INITIALIZE_PASS_END(GVN, "gvn", "Global Value Numbering", false, false)
>
> +#ifndef NDEBUG
> void GVN::dump(DenseMap<uint32_t, Value*>& d) {
> errs() << "{\n";
> for (DenseMap<uint32_t, Value*>::iterator I = d.begin(),
> @@ -641,6 +642,7 @@
> }
> errs() << "}\n";
> }
> +#endif
>
> /// IsValueFullyAvailableInBlock - Return true if we can prove that the value
> /// we're analyzing is fully available in the specified block. As we go, keep
>
> Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Thu Sep 6 14:55:56 2012
> @@ -121,9 +121,11 @@
> OS << "[NumUses=" << UsedByIndices.count() << ']';
> }
>
> +#ifndef NDEBUG
> void RegSortData::dump() const {
> print(errs()); errs() << '\n';
> }
> +#endif
>
> namespace {
>
> @@ -414,9 +416,11 @@
> }
> }
>
> +#ifndef NDEBUG
> void Formula::dump() const {
> print(errs()); errs() << '\n';
> }
> +#endif
>
> /// isAddRecSExtable - Return true if the given addrec can be sign-extended
> /// without changing its value.
> @@ -974,9 +978,11 @@
> OS << ", plus " << SetupCost << " setup cost";
> }
>
> +#ifndef NDEBUG
> void Cost::dump() const {
> print(errs()); errs() << '\n';
> }
> +#endif
>
> namespace {
>
> @@ -1060,9 +1066,11 @@
> OS << ", Offset=" << Offset;
> }
>
> +#ifndef NDEBUG
> void LSRFixup::dump() const {
> print(errs()); errs() << '\n';
> }
> +#endif
>
> namespace {
>
> @@ -1252,9 +1260,11 @@
> OS << ", widest fixup type: " << *WidestFixupType;
> }
>
> +#ifndef NDEBUG
> void LSRUse::dump() const {
> print(errs()); errs() << '\n';
> }
> +#endif
>
> /// isLegalUse - Test whether the use described by AM is "legal", meaning it can
> /// be completely folded into the user instruction at isel time. This includes
> @@ -3436,9 +3446,11 @@
> << " , add offset " << Imm;
> }
>
> +#ifndef NDEBUG
> void WorkItem::dump() const {
> print(errs()); errs() << '\n';
> }
> +#endif
>
> /// GenerateCrossUseConstantOffsets - Look for registers which are a constant
> /// distance apart and try to form reuse opportunities between them.
> @@ -4731,9 +4743,11 @@
> print_uses(OS);
> }
>
> +#ifndef NDEBUG
> void LSRInstance::dump() const {
> print(errs()); errs() << '\n';
> }
> +#endif
>
> namespace {
>
>
> Modified: llvm/trunk/lib/Transforms/Utils/AddrModeMatcher.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/AddrModeMatcher.cpp?rev=163344&r1=163343&r2=163344&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Utils/AddrModeMatcher.cpp (original)
> +++ llvm/trunk/lib/Transforms/Utils/AddrModeMatcher.cpp Thu Sep 6 14:55:56 2012
> @@ -55,10 +55,12 @@
> OS << ']';
> }
>
> +#ifndef NDEBUG
> void ExtAddrMode::dump() const {
> print(dbgs());
> dbgs() << '\n';
> }
> +#endif
>
>
> /// MatchScaledValue - Try adding ScaleReg*Scale to the current addressing mode.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
More information about the llvm-commits
mailing list