Fix some GCC warnings by providing a virtual destructor in the base of a class
authorChandler Carruth <chandlerc@gmail.com>
Mon, 23 Aug 2010 08:25:07 +0000 (08:25 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 23 Aug 2010 08:25:07 +0000 (08:25 +0000)
hierarchy with virtual methods and using llvm_unreachable to properly indicate
unreachable states which would otherwise leave variables uninitialized.

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

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
utils/TableGen/ClangAttrEmitter.cpp

index c9ad3ca5bf690d39edbb19c00248fb847c202dc5..5f555934bae843b1d20911d410b5b5a4760a8c32 100644 (file)
@@ -1327,7 +1327,7 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) {
               break;
             case ISD::SEXTLOAD: ExtendOp = ISD::SIGN_EXTEND; break;
             case ISD::ZEXTLOAD: ExtendOp = ISD::ZERO_EXTEND; break;
-            default: assert(0 && "Unexpected extend load type!");
+            default: llvm_unreachable("Unexpected extend load type!");
             }
             Result = DAG.getNode(ExtendOp, dl, Node->getValueType(0), Load);
             Tmp1 = LegalizeOp(Result);  // Relegalize new nodes.
index ee606e0e50f23e32e485b712eb53bde8b68ec337..74ff6684265215aa4ca994df671d674a832aeb1a 100644 (file)
@@ -71,6 +71,7 @@ namespace {
         upperName[0] = std::toupper(upperName[0]);
       }
     }
+    virtual ~Argument() {}
 
     StringRef getLowerName() const { return lowerName; }
     StringRef getUpperName() const { return upperName; }