aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Instructions.h6
-rw-r--r--lib/VMCore/AsmWriter.cpp4
2 files changed, 7 insertions, 3 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index 8d912f2..1335031 100644
--- a/include/llvm/Instructions.h
+++ b/include/llvm/Instructions.h
@@ -2375,7 +2375,11 @@ public:
return getOperand(0);
}
- unsigned getIndex() {
+ inline unsigned getIndex() {
+ return Idx;
+ }
+
+ inline const unsigned getIndex() const {
return Idx;
}
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index 8a7eec9..adbcd78 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -1291,7 +1291,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
writeOperand(I.getOperand(op ), false); Out << ',';
writeOperand(I.getOperand(op+1), false); Out << " ]";
}
- } else if (isa<GetResultInst>(I)) {
+ } else if (const GetResultInst *GRI = dyn_cast<GetResultInst>(&I)) {
const StructType *STy = cast<StructType>(I.getOperand(0)->getType());
unsigned NumElems = STy->getNumElements();
Out << " {";
@@ -1303,7 +1303,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
}
Out << " }";
writeOperand(I.getOperand(0), false);
- Out << ", " << cast<GetResultInst>(I).getIndex();
+ Out << ", " << GRI->getIndex();
} else if (isa<ReturnInst>(I) && !Operand) {
Out << " void";
} else if (const CallInst *CI = dyn_cast<CallInst>(&I)) {