Skip to content
Commit cb4685c0 authored by Gabor Greif's avatar Gabor Greif
Browse files

Simplify this class by removing the result cache.

This change removes the DefaultConstructible
and CopyAssignable constraints on the template
parameter T (the first one).

The second template parameter (R) is defaulted to be
identical to the first and controls the result type.
By specifying it to be (const T&) additionally the
CopyConstructible constraint on T can be removed.

This allows to use StringSwitch e.g. for llvm::Constant
instances.

Regarding the other review feedback regarding performance
because of taking pointers, this class should be completely
optimizable like before, since all methods are inline and
the pointer dereferencing and result value caching should be
possible behind the scenes by the "as-if" rule.

llvm-svn: 91123
parent b11118bd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment