summaryrefslogtreecommitdiff
path: root/include/llvm/IntrinsicInst.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-08-25 05:24:07 +0000
committerDevang Patel <dpatel@apple.com>2009-08-25 05:24:07 +0000
commit2a610c7387664bc557a35ce3bb4c0d4df56e4755 (patch)
tree48270c87c6b683ff972a9e35651d27e620881118 /include/llvm/IntrinsicInst.h
parent4bda11fbdafc1d4fa97b7539bdf5a0f62ecfc280 (diff)
downloadllvm-2a610c7387664bc557a35ce3bb4c0d4df56e4755.tar.gz
llvm-2a610c7387664bc557a35ce3bb4c0d4df56e4755.tar.bz2
llvm-2a610c7387664bc557a35ce3bb4c0d4df56e4755.tar.xz
Update DebugInfo interface to use metadata, instead of special named llvm.dbg.... global variables, to encode debugging information in llvm IR. This is mostly a mechanical change that tests metadata support very well.
This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured by compiling InstructionCombining.cpp!) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79977 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/IntrinsicInst.h')
-rw-r--r--include/llvm/IntrinsicInst.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/include/llvm/IntrinsicInst.h b/include/llvm/IntrinsicInst.h
index b8480551b5..a502cc27bc 100644
--- a/include/llvm/IntrinsicInst.h
+++ b/include/llvm/IntrinsicInst.h
@@ -25,6 +25,7 @@
#define LLVM_INTRINSICINST_H
#include "llvm/Constants.h"
+#include "llvm/Metadata.h"
#include "llvm/Function.h"
#include "llvm/Instructions.h"
#include "llvm/Intrinsics.h"
@@ -85,8 +86,8 @@ namespace llvm {
struct DbgStopPointInst : public DbgInfoIntrinsic {
Value *getLineValue() const { return const_cast<Value*>(getOperand(1)); }
Value *getColumnValue() const { return const_cast<Value*>(getOperand(2)); }
- Value *getContext() const {
- return StripCast(getOperand(3));
+ MDNode *getContext() const {
+ return cast<MDNode>(getOperand(3));
}
unsigned getLine() const {
@@ -112,7 +113,7 @@ namespace llvm {
/// DbgFuncStartInst - This represents the llvm.dbg.func.start instruction.
///
struct DbgFuncStartInst : public DbgInfoIntrinsic {
- Value *getSubprogram() const { return StripCast(getOperand(1)); }
+ MDNode *getSubprogram() const { return cast<MDNode>(getOperand(1)); }
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const DbgFuncStartInst *) { return true; }
@@ -127,7 +128,7 @@ namespace llvm {
/// DbgRegionStartInst - This represents the llvm.dbg.region.start
/// instruction.
struct DbgRegionStartInst : public DbgInfoIntrinsic {
- Value *getContext() const { return StripCast(getOperand(1)); }
+ MDNode *getContext() const { return cast<MDNode>(getOperand(1)); }
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const DbgRegionStartInst *) { return true; }
@@ -142,7 +143,7 @@ namespace llvm {
/// DbgRegionEndInst - This represents the llvm.dbg.region.end instruction.
///
struct DbgRegionEndInst : public DbgInfoIntrinsic {
- Value *getContext() const { return StripCast(getOperand(1)); }
+ MDNode *getContext() const { return cast<MDNode>(getOperand(1)); }
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const DbgRegionEndInst *) { return true; }
@@ -158,7 +159,7 @@ namespace llvm {
///
struct DbgDeclareInst : public DbgInfoIntrinsic {
Value *getAddress() const { return getOperand(1); }
- Value *getVariable() const { return StripCast(getOperand(2)); }
+ MDNode *getVariable() const { return cast<MDNode>(getOperand(2)); }
// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const DbgDeclareInst *) { return true; }