mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-02 15:51:54 +00:00
Implement CodeGen/CBackend/2005-02-14-VolatileOperations.ll
Volatile loads and stores need to emit volatile pointer operations in C. llvm-svn: 20177
This commit is contained in:
parent
907f3d8b67
commit
ef836a918e
@ -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…
x
Reference in New Issue
Block a user