Remove #include of metadata.h from intrinsicinst.h. The only
authorChris Lattner <sabre@nondot.org>
Thu, 31 Dec 2009 01:32:41 +0000 (01:32 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 31 Dec 2009 01:32:41 +0000 (01:32 +0000)
method that needs it (DbgValueInst::getValue) has been moved out
of line.

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

include/llvm/IntrinsicInst.h
include/llvm/Value.h
lib/VMCore/IntrinsicInst.cpp

index 9893e1f8780a0854e31e90e55a11d78bb1457717..3c18de10674000e619d79a641fc74f4c98dcc4b5 100644 (file)
@@ -25,7 +25,6 @@
 #define LLVM_INTRINSICINST_H
 
 #include "llvm/Constants.h"
-#include "llvm/Metadata.h"
 #include "llvm/Function.h"
 #include "llvm/Instructions.h"
 #include "llvm/Intrinsics.h"
@@ -175,9 +174,7 @@ namespace llvm {
   /// DbgValueInst - This represents the llvm.dbg.value instruction.
   ///
   struct DbgValueInst : public DbgInfoIntrinsic {
-    Value *getValue() const {
-      return cast<MDNode>(getOperand(1))->getOperand(0);
-    }
+    Value *getValue() const;
     Value *getOffset() const { return getOperand(2); }
     MDNode *getVariable() const { return cast<MDNode>(getOperand(3)); }
 
index 4d94a30191650e6e38e87bc8cac759a988130f06..f0bd8bea1ede4404e86db541a2ab370c7a949036 100644 (file)
@@ -42,6 +42,7 @@ class AssemblyAnnotationWriter;
 class ValueHandleBase;
 class LLVMContext;
 class Twine;
+class MDNode;
 
 //===----------------------------------------------------------------------===//
 //                                 Value Class
@@ -350,6 +351,9 @@ template <> inline bool isa_impl<GlobalValue, Value>(const Value &Val) {
   return isa<GlobalVariable>(Val) || isa<Function>(Val) ||
          isa<GlobalAlias>(Val);
 }
+template <> inline bool isa_impl<MDNode, Value>(const Value &Val) {
+  return Val.getValueID() == Value::MDNodeVal;
+}
   
   
 // Value* is only 4-byte aligned.
index b508f6b4ca9bb978f1e3f0f2dd3f950372e2ca1b..5e0f42e063bf870be97f675ff04fde1e0d3a17d4 100644 (file)
@@ -69,3 +69,11 @@ Value *DbgStopPointInst::getDirectory() const {
   assert(LLVMDebugVersion == (7 << 16) && "Verify operand indices");
   return getContext()->getOperand(4);
 }
+
+//===----------------------------------------------------------------------===//
+/// DbgValueInst - This represents the llvm.dbg.value instruction.
+///
+
+Value *DbgValueInst::getValue() const {
+  return cast<MDNode>(getOperand(1))->getOperand(0);
+}