Use a more obvious way to avoid compiling functions which are only used when XDEBUG...
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 29 Jun 2010 10:03:11 +0000 (10:03 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 29 Jun 2010 10:03:11 +0000 (10:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107125 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BasicAliasAnalysis.cpp

index 7a334ff8464bc816e33ced4ed2e694b3be50544f..e6e9e36ae77d4291439bb6def6b6e81ec074582f 100644 (file)
@@ -29,7 +29,6 @@
 #include "llvm/Target/TargetData.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallVector.h"
-#include "llvm/Support/Compiler.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <algorithm>
 using namespace llvm;
@@ -198,6 +197,7 @@ ImmutablePass *llvm::createNoAAPass() { return new NoAA(); }
 // BasicAliasAnalysis Pass
 //===----------------------------------------------------------------------===//
 
+#ifdef XDEBUG
 static const Function *getParent(const Value *V) {
   if(const Instruction *inst = dyn_cast<Instruction>(V))
     return inst->getParent()->getParent();
@@ -208,8 +208,6 @@ static const Function *getParent(const Value *V) {
   return NULL;
 }
 
-static bool sameParent(const Value *O1, const Value *O2) ATTRIBUTE_UNUSED;
-
 static bool sameParent(const Value *O1, const Value *O2) {
 
   const Function *F1 = getParent(O1);
@@ -217,6 +215,7 @@ static bool sameParent(const Value *O1, const Value *O2) {
 
   return !F1 || !F2 || F1 == F2;
 }
+#endif
 
 namespace {
   /// BasicAliasAnalysis - This is the default alias analysis implementation.