mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-31 08:16:47 +00:00 
			
		
		
		
	memset and bcopy and now unified by the llvm.memset intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11503 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		| @@ -468,6 +468,11 @@ void GraphBuilder::visitCallSite(CallSite CS) { | |||||||
|           N->setModifiedMarker()->setReadMarker(); |           N->setModifiedMarker()->setReadMarker(); | ||||||
|         return; |         return; | ||||||
|       } |       } | ||||||
|  |       case Intrinsic::memset: | ||||||
|  |         // Mark the memory modified. | ||||||
|  |         if (DSNode *N = getValueDest(**CS.arg_begin()).getNode()) | ||||||
|  |           N->setModifiedMarker(); | ||||||
|  |         return; | ||||||
|       default: |       default: | ||||||
|         if (F->getName() == "calloc") { |         if (F->getName() == "calloc") { | ||||||
|           setDestTo(*CS.getInstruction(), |           setDestTo(*CS.getInstruction(), | ||||||
| @@ -479,20 +484,6 @@ void GraphBuilder::visitCallSite(CallSite CS) { | |||||||
|           if (DSNode *N = RetNH.getNode()) |           if (DSNode *N = RetNH.getNode()) | ||||||
|             N->setHeapNodeMarker()->setModifiedMarker()->setReadMarker(); |             N->setHeapNodeMarker()->setModifiedMarker()->setReadMarker(); | ||||||
|           return; |           return; | ||||||
|         } else if (F->getName() == "memset") { |  | ||||||
|           // Merge the first argument with the return value, and mark the memory |  | ||||||
|           // modified. |  | ||||||
|           DSNodeHandle RetNH = getValueDest(*CS.getInstruction()); |  | ||||||
|           RetNH.mergeWith(getValueDest(**CS.arg_begin())); |  | ||||||
|           if (DSNode *N = RetNH.getNode()) |  | ||||||
|             N->setModifiedMarker(); |  | ||||||
|           return; |  | ||||||
|         } else if (F->getName() == "bzero") { |  | ||||||
|           // Mark the memory modified. |  | ||||||
|           DSNodeHandle H = getValueDest(**CS.arg_begin()); |  | ||||||
|           if (DSNode *N = H.getNode()) |  | ||||||
|             N->setModifiedMarker(); |  | ||||||
|           return; |  | ||||||
|         } else if (F->getName() == "fopen" && CS.arg_end()-CS.arg_begin() == 2){ |         } else if (F->getName() == "fopen" && CS.arg_end()-CS.arg_begin() == 2){ | ||||||
|           // fopen reads the mode argument strings. |           // fopen reads the mode argument strings. | ||||||
|           CallSite::arg_iterator AI = CS.arg_begin(); |           CallSite::arg_iterator AI = CS.arg_begin(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user