mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Implement CodeGen/CBackend/2005-02-14-VolatileOperations.ll
Volatile loads and stores need to emit volatile pointer operations in C. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20177 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ee6cfda17c
commit
9d30e22da0
@ -1655,12 +1655,27 @@ void CWriter::printIndexingExpression(Value *Ptr, gep_type_iterator I,
|
||||
|
||||
void CWriter::visitLoadInst(LoadInst &I) {
|
||||
Out << "*";
|
||||
if (I.isVolatile()) {
|
||||
Out << "((volatile ";
|
||||
printType(Out, I.getOperand(0)->getType());
|
||||
Out << ")";
|
||||
}
|
||||
|
||||
writeOperand(I.getOperand(0));
|
||||
|
||||
if (I.isVolatile())
|
||||
Out << ")";
|
||||
}
|
||||
|
||||
void CWriter::visitStoreInst(StoreInst &I) {
|
||||
Out << "*";
|
||||
if (I.isVolatile()) {
|
||||
Out << "((volatile ";
|
||||
printType(Out, I.getPointerOperand()->getType());
|
||||
Out << ")";
|
||||
}
|
||||
writeOperand(I.getPointerOperand());
|
||||
if (I.isVolatile()) Out << ")";
|
||||
Out << " = ";
|
||||
writeOperand(I.getOperand(0));
|
||||
}
|
||||
|
@ -1655,12 +1655,27 @@ void CWriter::printIndexingExpression(Value *Ptr, gep_type_iterator I,
|
||||
|
||||
void CWriter::visitLoadInst(LoadInst &I) {
|
||||
Out << "*";
|
||||
if (I.isVolatile()) {
|
||||
Out << "((volatile ";
|
||||
printType(Out, I.getOperand(0)->getType());
|
||||
Out << ")";
|
||||
}
|
||||
|
||||
writeOperand(I.getOperand(0));
|
||||
|
||||
if (I.isVolatile())
|
||||
Out << ")";
|
||||
}
|
||||
|
||||
void CWriter::visitStoreInst(StoreInst &I) {
|
||||
Out << "*";
|
||||
if (I.isVolatile()) {
|
||||
Out << "((volatile ";
|
||||
printType(Out, I.getPointerOperand()->getType());
|
||||
Out << ")";
|
||||
}
|
||||
writeOperand(I.getPointerOperand());
|
||||
if (I.isVolatile()) Out << ")";
|
||||
Out << " = ";
|
||||
writeOperand(I.getOperand(0));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user