Substitute unscoped template names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82119 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anders Carlsson 2009-09-17 04:02:31 +00:00
Родитель 6793966aa2
Коммит 03c9d530db
3 изменённых файлов: 17 добавлений и 10 удалений

Просмотреть файл

@ -276,7 +276,11 @@ void CXXNameMangler::mangleUnscopedName(const NamedDecl *ND) {
void CXXNameMangler::mangleUnscopedTemplateName(const FunctionDecl *FD) { void CXXNameMangler::mangleUnscopedTemplateName(const FunctionDecl *FD) {
// <unscoped-template-name> ::= <unscoped-name> // <unscoped-template-name> ::= <unscoped-name>
// ::= <substitution> // ::= <substitution>
if (mangleSubstitution(FD))
return;
mangleUnscopedName(FD); mangleUnscopedName(FD);
addSubstitution(FD);
} }
void CXXNameMangler::mangleCalloffset(int64_t nv, int64_t v) { void CXXNameMangler::mangleCalloffset(int64_t nv, int64_t v) {

Просмотреть файл

@ -8,12 +8,10 @@ T* next(T* ptr, const U& diff) {
} }
void test(int *iptr, float *fptr, int diff) { void test(int *iptr, float *fptr, int diff) {
// FIXME: should be "_Z4nextIiiEPT_S1_RKT0_" // CHECK: _Z4nextIiiEPT_S1_RKT0_
// CHECK: _Z4nextIiiEPT_S0_RKT0_
iptr = next(iptr, diff); iptr = next(iptr, diff);
// FIXME: should be "_Z4nextIfiEPT_S1_RKT0_"
// CHECK: _Z4nextIfiEPT_S0_RKT0_
// CHECK: _Z4nextIfiEPT_S1_RKT0_
fptr = next(fptr, diff); fptr = next(fptr, diff);
} }
@ -22,7 +20,7 @@ T* next(T* ptr, const U& diff);
void test2(int *iptr, double *dptr, int diff) { void test2(int *iptr, double *dptr, int diff) {
iptr = next(iptr, diff); iptr = next(iptr, diff);
// FIXME: should be "_Z4nextIdiEPT_S1_RKT0_"
// CHECK: _Z4nextIiiEPT_S0_RKT0_ // CHECK: _Z4nextIdiEPT_S1_RKT0_
dptr = next(dptr, diff); dptr = next(dptr, diff);
} }

Просмотреть файл

@ -88,9 +88,14 @@ void f(void (S::*)()) {}
// CHECK: define void @_Z1fi // CHECK: define void @_Z1fi
void f(const int) { } void f(const int) { }
// CHECK: define linkonce_odr void @_Z2tfIidEvT0_T_ template<typename T, typename U> void ft1(U u, T t) { }
template<typename T, typename U> void tf(U u, T t) { }
template<typename T> void ft2(T t, void (*)(T), void (*)(T)) { }
void g() { void g() {
tf<int, double>(1, 0); // CHECK: @_Z3ft1IidEvT0_T_
ft1<int, double>(1, 0);
// CHECK: @_Z3ft2IcEvT_PFvS0_ES2_
ft2<char>(1, 0, 0);
} }