Factor out thread-safe uniqu'ing backed by vector in MLIRcontext
authorAlex Zinenko <zinenko@google.com>
Tue, 23 Apr 2019 09:37:07 +0000 (02:37 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Wed, 24 Apr 2019 05:02:50 +0000 (22:02 -0700)
commit06ca99530d29941cc0d0dc9feb1cab4f6562fd3f
tree5dc15409cd6fe9f62850fc5a346e186048ae0d2d
parentea86e7652e88600cceb45d2113082fbfcf7e78dd
Factor out thread-safe uniqu'ing backed by vector in MLIRcontext

    Extract common code from getAffineSymbolExpr and getAffineConstantExpr into a
    utility function safeGetOrCreate, similarly to the existing overloads for sets
    and maps.  The position in the vector is used as indexing key.  NFC.

--

PiperOrigin-RevId: 244820859
mlir/lib/IR/MLIRContext.cpp