clang

Hello, everyone.

  1. I found someone uses function StringMap::GetOrCreateValue many times in clang. But it does exist in class StringMap.So I added tow overloaded functions of this name.
  2. the return value type of function StringSet::insert, is as bellow:
    std::pair<typename base::iterator, bool>

I have an old versioned llvm/clang code. this return value type is bool
I think the current status is right.But some calls of this function is the clang has not been modified, i.e the codes are still like:
if (some_string_set.insert( … ))
I have modified some places.
3) similar problems exist with function SmallPointerSet::insert()
but ,so many many places to modify.
I have only modified a few places.Sorry!

clang.patch (13.6 KB)

StringMap.h.patch (833 Bytes)

   Hello, everyone.
    1) I found someone uses function StringMap::GetOrCreateValue many
times in clang. But it does exist in class StringMap.So I added tow
overloaded functions of this name.

These were removed a couple of months ago in r222306.

    2) the return value type of function StringSet::insert, is as bellow:
        *std::pair<typename base::iterator, bool>*

        I have an old versioned llvm/clang code. this return value type
is bool
        I think the current status is right.But some calls of this
function is the clang has not been modified, i.e the codes are still like:
    if (some_string_set.insert( ... ))
        I have modified some places.

The right return type for a map insert is pair<iterator, bool> to be
compatible with STL containers/concepts.

    3) similar problems exist with function SmallPointerSet::insert()
        but ,so many many places to modify.
        I have only modified a few places.Sorry!

If you sync up your LLVM and Clang projects you should find they build
without any need for further modification.