DataLayout::getPointerSize() supposed to be used with the address space argument, though it has default value 0 for the transition period. There are the cases when some kind of a general pointer size is desirable, such as with debug info. In some places DataLayout is used though. This creates problem if target is 64 bit, but some address spaces are 32 bit, and notably if address space 0 has 32 bit pointers in 64 bit mode. An example of such target is HSAIL.
In this change calls to DataLayout::getPointerSize() are replaced with recently added AsmPrinter::getPointerSize() in DWARF debug code. The AsmPrinter::getPointerSize() itself is modified to call MAI->getPointerSize(). Originally it was calling TargetMachine::getPointerSize() which ends up in the DataLayout::getPointerSize() with the default argument. Since this call is not virtual in both AsmPrinter and TargetMachine that makes a little sense to override it in the target implementation for DWARF info purposes. The MCAsmInfo implementation has the benefit to query member variable PointerSize which can be previously initialized by the target, thus target will have control over the returned value.
In LLVM 3.6 many (but not all) of the getPointerSize() references in DWARF info were pointing to the MAI implementation, but recently that was changed to the new AsmPrinter and TargetMachine functions.