IR: Remove MDNodeFwdDecl
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 19 Jan 2015 20:36:39 +0000 (20:36 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Mon, 19 Jan 2015 20:36:39 +0000 (20:36 +0000)
commit8ec0aee3b4a0b038732f30226999145d666186f2
tree9cba95369c77347de4a4c58bc2583113b8f7ed6d
parentdc8beeba1b4cd39941571e8be363fb4cca729d16
IR: Remove MDNodeFwdDecl

Remove `MDNodeFwdDecl` (as promised in r226481).  Aside from API
changes, there's no real functionality change here.
`MDNode::getTemporary()` now forwards to `MDTuple::getTemporary()`,
which returns a tuple with `isTemporary()` equal to true.

The main point is that we can now add temporaries of other `MDNode`
subclasses, needed for PR22235 (I introduced `MDNodeFwdDecl` in the
first place because I didn't recognize this need, and thought they were
only needed to handle forward references).

A few things left out of (or highlighted by) this commit:

  - I've had to remove the (few) uses of `std::unique_ptr<>` to deal
    with temporaries, since the destructor is no longer public.
    `getTemporary()` should probably return the equivalent of
    `std::unique_ptr<T, MDNode::deleteTemporary>`.
  - `MDLocation::getTemporary()` doesn't exist yet (worse, it actually
    does exist, but does the wrong thing: `MDNode::getTemporary()` is
    inherited and returns an `MDTuple`).
  - `MDNode` now only has one subclass, `UniquableMDNode`, and the
    distinction between them is actually somewhat confusing.

I'll fix those up next.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226501 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
bindings/go/llvm/IRBindings.cpp
include/llvm/IR/DIBuilder.h
include/llvm/IR/Metadata.def
include/llvm/IR/Metadata.h
lib/AsmParser/LLParser.cpp
lib/AsmParser/LLParser.h
lib/Bitcode/Reader/BitcodeReader.cpp
lib/IR/DebugInfo.cpp
lib/IR/Metadata.cpp
lib/IR/Verifier.cpp
lib/Transforms/Utils/InlineFunction.cpp
lib/Transforms/Utils/ValueMapper.cpp
unittests/IR/MetadataTest.cpp