diff --git a/include/llvm/CodeGen/MachineCodeForInstruction.h b/include/llvm/CodeGen/MachineCodeForInstruction.h index aa6ddd55ca1..2193a80e529 100644 --- a/include/llvm/CodeGen/MachineCodeForInstruction.h +++ b/include/llvm/CodeGen/MachineCodeForInstruction.h @@ -35,10 +35,11 @@ public: static MachineCodeForInstruction &get(const Instruction *I) { assert(I != NULL); - return *(MachineCodeForInstruction*)I->getOrCreateAnnotation(MCFI_AID); + return *(MachineCodeForInstruction*) + ((Annotable*)I)->getOrCreateAnnotation(MCFI_AID); } static void destroy(const Instruction *I) { - I->deleteAnnotation(MCFI_AID); + ((Annotable*)I)->deleteAnnotation(MCFI_AID); } // Access to underlying machine instructions... diff --git a/lib/Target/SparcV9/MachineCodeForInstruction.h b/lib/Target/SparcV9/MachineCodeForInstruction.h index aa6ddd55ca1..2193a80e529 100644 --- a/lib/Target/SparcV9/MachineCodeForInstruction.h +++ b/lib/Target/SparcV9/MachineCodeForInstruction.h @@ -35,10 +35,11 @@ public: static MachineCodeForInstruction &get(const Instruction *I) { assert(I != NULL); - return *(MachineCodeForInstruction*)I->getOrCreateAnnotation(MCFI_AID); + return *(MachineCodeForInstruction*) + ((Annotable*)I)->getOrCreateAnnotation(MCFI_AID); } static void destroy(const Instruction *I) { - I->deleteAnnotation(MCFI_AID); + ((Annotable*)I)->deleteAnnotation(MCFI_AID); } // Access to underlying machine instructions...