For PR387:
authorReid Spencer <rspencer@reidspencer.com>
Mon, 28 Aug 2006 01:02:49 +0000 (01:02 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Mon, 28 Aug 2006 01:02:49 +0000 (01:02 +0000)
Close out this long standing bug by removing the remaining overloaded
virtual functions in LLVM. The -Woverloaded-virtual option is now turned on.

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

Makefile.rules
include/llvm/Assembly/Writer.h
lib/Analysis/DataStructure/Steensgaard.cpp
lib/Analysis/IPA/Andersens.cpp
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCISelLowering.h
lib/VMCore/AsmWriter.cpp
tools/opt/GraphPrinters.cpp

index 8c595c289f70966bce005ff5ad7ee1086341e8c5..457c7f8a27cf08258d0c4462515bd04fd8b4fddc 100644 (file)
@@ -254,7 +254,7 @@ else
   C.Flags   += -D_DEBUG
 endif
 
-CXX.Flags     += $(CXXFLAGS)
+CXX.Flags     += $(CXXFLAGS) -Woverloaded-virtual
 C.Flags       += $(CFLAGS)
 CPP.BaseFlags += $(CPPFLAGS)
 LD.Flags      += $(LDFLAGS)
index c8c09e809eb343ba104325fbc9f83411be3b8469..8b96d0db15a874b9bb571807f74014d4842b8f00 100644 (file)
@@ -43,6 +43,10 @@ std::ostream &WriteAsOperand(std::ostream &, const Value *, bool PrintTy = true,
 std::ostream &WriteAsOperand(std::ostream&, const Type*, bool PrintTy = true,
                              bool PrintName = true, const Module* Context = 0);
 
+#ifndef NDEBUG
+void dumpType(const Type* Ty);
+void dumpValue(const Value* Val);
+#endif
 } // End llvm namespace
 
 #endif
index c7e32202cf709a1345a9b7cd34c1f5eda11543c7..eb5b74ca0227e10704b24538afdecf3c39a9d685 100644 (file)
@@ -65,7 +65,8 @@ namespace {
     AliasResult alias(const Value *V1, unsigned V1Size,
                       const Value *V2, unsigned V2Size);
 
-    ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size);
+    virtual ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size);
+    virtual ModRefResult getModRefInfo(CallSite CS1, CallSite CS2);
 
   private:
     void ResolveFunctionCall(Function *F, const DSCallSite &Call,
@@ -266,3 +267,9 @@ Steens::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
 
   return (ModRefResult)(Result & AliasAnalysis::getModRefInfo(CS, P, Size));
 }
+
+AliasAnalysis::ModRefResult 
+Steens::getModRefInfo(CallSite CS1, CallSite CS2)
+{
+  return AliasAnalysis::getModRefInfo(CS1,CS2);
+}
index c9f5871b7251cf8f3a32b9ac4c6674d0532f1a7a..bb3f25427c8f2567e1bc9a6ddf87c840a3ba1807 100644 (file)
@@ -236,7 +236,8 @@ namespace {
     //
     AliasResult alias(const Value *V1, unsigned V1Size,
                       const Value *V2, unsigned V2Size);
-    ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size);
+    virtual ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size);
+    virtual ModRefResult getModRefInfo(CallSite CS1, CallSite CS2);
     void getMustAliases(Value *P, std::vector<Value*> &RetVals);
     bool pointsToConstantMemory(const Value *P);
 
@@ -387,6 +388,11 @@ Andersens::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
   return AliasAnalysis::getModRefInfo(CS, P, Size);
 }
 
+AliasAnalysis::ModRefResult
+Andersens::getModRefInfo(CallSite CS1, CallSite CS2) {
+  return AliasAnalysis::getModRefInfo(CS1,CS2);
+}
+
 /// getMustAlias - We can provide must alias information if we know that a
 /// pointer can only point to a specific function or the null pointer.
 /// Unfortunately we cannot determine must-alias information for global
index 067063df2590e6dd4873163a3728229013def97f..31e209adf411e429bd185dd09ac6f898fd1d7449 100644 (file)
@@ -2691,3 +2691,7 @@ bool PPCTargetLowering::isLegalAddressImmediate(int64_t V) const {
   // PPC allows a sign-extended 16-bit immediate field.
   return (V > -(1 << 16) && V < (1 << 16)-1);
 }
+
+bool PPCTargetLowering::isLegalAddressImmediate(llvm::GlobalValue* GV) const {
+  return TargetLowering::isLegalAddressImmediate(GV); 
+}
index d9defe232414acc26dda9f4cef68fd4835fc9cd3..467b3f0955d4d098952745e3aee88f786a25b435 100644 (file)
@@ -199,6 +199,7 @@ namespace llvm {
     /// isLegalAddressImmediate - Return true if the integer value can be used
     /// as the offset of the target addressing mode.
     virtual bool isLegalAddressImmediate(int64_t V) const;
+    virtual bool isLegalAddressImmediate(llvm::GlobalValue*) const;
   };
 }
 
index 890b5986874ad9aa5e5620b2132f47df8c8a5cae..f3bcfb53ba5cc6b9d56ecc20cc10d47aa1cfb229 100644 (file)
@@ -1081,8 +1081,7 @@ void AssemblyWriter::printInfoComment(const Value &V) {
   }
 }
 
-/// printInstruction - This member is called for each Instruction in a function..
-///
+// This member is called for each Instruction in a function..
 void AssemblyWriter::printInstruction(const Instruction &I) {
   if (AnnotationWriter) AnnotationWriter->emitInstructionAnnot(&I, Out);
 
index 8ae0a0340ce033605e0f0f06fd416970bd180677..8c0ef776c2ea0e25bbefdca3fb700c98e184e6db 100644 (file)
@@ -65,6 +65,7 @@ namespace {
     }
 
     void print(std::ostream &OS) const {}
+    void print(std::ostream &OS, const llvm::Module*) const {}
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.addRequired<CallGraph>();