mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-03 07:38:57 +00:00
3b65ed0a5c
by eliminating the type ID from constructor, destructor, and conversion function names. There are several reasons for this change: - A given type (say, int*) isn't guaranteed to have a single, unique type ID within a chain of PCH files. Hence, we could end up hashing based on the wrong type ID, causing name lookup to fail. - The mapping from types back to type IDs required one DenseMap entry for every type that was ever deserialized, which was an unacceptable cost to support just the name lookup of constructors, destructors, and conversion functions. Plus, this mapping could never actually work with chained or multiple PCH, based on the first bullet. Once we have eliminated the type from the hash function, these problems go away, as does my horrible "reverse type remap" hack, which was doomed from the start (see bullet #1 above) and far too complicated. However, note that removing the type from the hash function means that all constructors, destructors, and conversion functions have the same hash key, so I've updated the caller to double-check that the declarations found have the appropriate name. llvm-svn: 136708
27 lines
390 B
C++
27 lines
390 B
C++
// RUN: %clang_cc1 %s -emit-llvm -o - -chain-include %s -chain-include %s
|
|
|
|
#if !defined(PASS1)
|
|
#define PASS1
|
|
struct X {
|
|
operator int*();
|
|
};
|
|
|
|
struct Z {
|
|
operator int*();
|
|
};
|
|
#elif !defined(PASS2)
|
|
#define PASS2
|
|
struct Y {
|
|
operator int *();
|
|
};
|
|
#else
|
|
int main() {
|
|
X x;
|
|
int *ip = x.operator int*();
|
|
Y y;
|
|
int *ip2 = y.operator int*();
|
|
Z z;
|
|
int *ip3 = z.operator int*();
|
|
}
|
|
#endif
|