diff --git a/docs/LangRef.html b/docs/LangRef.html index df6baa74632..f9e0824260a 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -2671,7 +2671,8 @@ allocate, and free memory in LLVM.

Overview:

The 'malloc' instruction allocates memory from the system -heap and returns a pointer to it.

+heap and returns a pointer to it. The object is always allocated in the generic +address space (address space zero).

Arguments:
@@ -2758,7 +2759,8 @@ after this instruction executes.

The 'alloca' instruction allocates memory on the stack frame of the currently executing function, to be automatically released when this function -returns to its caller.

+returns to its caller. The object is always allocated in the generic address +space (address space zero).

Arguments:
@@ -3972,6 +3974,10 @@ Front-ends for type-safe garbage collected languages should generate these intrinsics to make use of the LLVM garbage collectors. For more details, see Accurate Garbage Collection with LLVM.

+ +

The garbage collection intrinsics only operate on objects in the generic + address space (address space zero).

+ diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index c3633ff97a1..fb8db1785da 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -254,6 +254,7 @@ namespace { // Anonymous namespace for class 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, ...); @@ -987,6 +988,13 @@ void Verifier::visitStoreInst(StoreInst &SI) { 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. ///