adapted sources to the current clang trunk