[llvm-commits] [llvm] r92323 - in /llvm/trunk: include/llvm/IntrinsicInst.h include/llvm/Value.h lib/VMCore/IntrinsicInst.cpp

Chris Lattner sabre at nondot.org
Wed Dec 30 17:32:41 PST 2009


Author: lattner
Date: Wed Dec 30 19:32:41 2009
New Revision: 92323

URL: http://llvm.org/viewvc/llvm-project?rev=92323&view=rev
Log:
Remove #include of metadata.h from intrinsicinst.h.  The only
method that needs it (DbgValueInst::getValue) has been moved out
of line.


Modified:
    llvm/trunk/include/llvm/IntrinsicInst.h
    llvm/trunk/include/llvm/Value.h
    llvm/trunk/lib/VMCore/IntrinsicInst.cpp

Modified: llvm/trunk/include/llvm/IntrinsicInst.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IntrinsicInst.h?rev=92323&r1=92322&r2=92323&view=diff

==============================================================================
--- llvm/trunk/include/llvm/IntrinsicInst.h (original)
+++ llvm/trunk/include/llvm/IntrinsicInst.h Wed Dec 30 19:32:41 2009
@@ -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 @@
   /// 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)); }
 

Modified: llvm/trunk/include/llvm/Value.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Value.h?rev=92323&r1=92322&r2=92323&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Value.h (original)
+++ llvm/trunk/include/llvm/Value.h Wed Dec 30 19:32:41 2009
@@ -42,6 +42,7 @@
 class ValueHandleBase;
 class LLVMContext;
 class Twine;
+class MDNode;
 
 //===----------------------------------------------------------------------===//
 //                                 Value Class
@@ -350,6 +351,9 @@
   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.

Modified: llvm/trunk/lib/VMCore/IntrinsicInst.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/IntrinsicInst.cpp?rev=92323&r1=92322&r2=92323&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/IntrinsicInst.cpp (original)
+++ llvm/trunk/lib/VMCore/IntrinsicInst.cpp Wed Dec 30 19:32:41 2009
@@ -69,3 +69,11 @@
   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);
+}





More information about the llvm-commits mailing list