<h5>Overview:</h5>
<p>The '<tt>malloc</tt>' instruction allocates memory from the system
-heap and returns a pointer to it.</p>
+heap and returns a pointer to it. The object is always allocated in the generic
+address space (address space zero).</p>
<h5>Arguments:</h5>
<p>The '<tt>alloca</tt>' instruction allocates memory on the stack frame of the
currently executing function, to be automatically released when this function
-returns to its caller.</p>
+returns to its caller. The object is always allocated in the generic address
+space (address space zero).</p>
<h5>Arguments:</h5>
intrinsics to make use of the LLVM garbage collectors. For more details, see <a
href="GarbageCollection.html">Accurate Garbage Collection with LLVM</a>.
</p>
+
+<p>The garbage collection intrinsics only operate on objects in the generic
+ address space (address space zero).</p>
+
</div>
<!-- _______________________________________________________________________ -->
void visitUserOp1(Instruction &I);
void visitUserOp2(Instruction &I) { visitUserOp1(I); }
void visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI);
+ void visitAllocationInst(AllocationInst &AI);
void VerifyIntrinsicPrototype(Intrinsic::ID ID, Function *F,
unsigned Count, ...);
visitInstruction(SI);
}
+void Verifier::visitAllocationInst(AllocationInst &AI) {
+ const PointerType *Ptr = AI.getType();
+ Assert(Ptr->getAddressSpace() == 0,
+ "Allocation instruction pointer not in the generic address space!");
+ visitInstruction(AI);
+}
+
/// verifyInstruction - Verify that an instruction is well formed.
///