[opaque pointer type] Avoid using pointee types to retrieve InlineAsm's function...
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 28 Jul 2015 00:06:38 +0000 (00:06 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 28 Jul 2015 00:06:38 +0000 (00:06 +0000)
commit04180d08dbf827905a44c866aab1dad5ca233bba
tree582edd34679bcacc0bbfb263f97d6307cab68a13
parent2261a25f889ed5415a9b837cf9a2638897e724c9
[opaque pointer type] Avoid using pointee types to retrieve InlineAsm's function type

As a stop-gap, retrieving the InlineAsm's function type was done via the
pointee type of its (pointer) Value type.

Instead, pass down and store the FunctionType in the InlineAsm object.

The only wrinkle with this is the ConstantUniqueMap, which then needs to
ferry the FunctionType down through the InlineAsmKeyType. This could be
done a bit differently if the ConstantInfo trait were broadened a bit to
provide an extension point for access to the TypeClass object from the
ValType objects, so that the ConstantUniqueMap<InlineAsm> would then be
keyed on FunctionTypes instead of PointerTypes that point to
FunctionTypes.

This drops the number of IR tests that don't roundtrip through bitcode*
without calling PointerType::getElementType from 416 to 8 (out of
10733). 3 of those crash when roundtripping at ToT anyway.

* modulo various unavoidable uses of pointer types when validating IR
  (for now) and in the way globals are parsed, unfortunately. These
  cases will either go away (because such validation will no longer be
  necessary or possible when pointee types are opaque), or have to be
  made simultaneously with the removal of pointee types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243356 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/InlineAsm.h
lib/IR/ConstantsContext.h
lib/IR/InlineAsm.cpp