mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-08 03:46:02 +03:00

Instead of letting our old copy silently go more and more out-of-sync. In this case, we missed the upstream fix wrt. skipping the declaration of ClassInfos for speculative class types. There are 2 noteworthy functional changes for function `getOrCreateTypeInfoDeclaration()`: 1) The old version always overwrote `torig->vtinfo` with `t->vtinfo` when declaring a new TypeInfo, whereas upstream's `genTypeInfo()` only sets it if it was null before. 2) The old version called `semanticTypeInfo()` during a semantic pass, upstream doesn't. The LDC-specific exception for class types in `builtinTypeInfo()` is still required. Fixes dmd-testsuite's runnable/b16278.d.
32 lines
1,023 B
C++
32 lines
1,023 B
C++
//===-- gen/typinf.h - TypeInfo declaration codegen -------------*- C++ -*-===//
|
||
//
|
||
// LDC – the LLVM D compiler
|
||
//
|
||
// This file is distributed under the BSD-style LDC license. See the LICENSE
|
||
// file for details.
|
||
//
|
||
//===----------------------------------------------------------------------===//
|
||
//
|
||
// Codegen for the TypeInfo types/constants required by the D run-time type
|
||
// information system.
|
||
//
|
||
//===----------------------------------------------------------------------===//
|
||
|
||
#ifndef LDC_GEN_TYPEINF_H
|
||
#define LDC_GEN_TYPEINF_H
|
||
|
||
struct IRState;
|
||
struct Scope;
|
||
class Type;
|
||
class TypeInfoDeclaration;
|
||
|
||
void DtoResolveTypeInfo(TypeInfoDeclaration *tid);
|
||
TypeInfoDeclaration *getOrCreateTypeInfoDeclaration(Type *t, Scope *sc);
|
||
void TypeInfoDeclaration_codegen(TypeInfoDeclaration *decl, IRState *p);
|
||
void TypeInfoClassDeclaration_codegen(TypeInfoDeclaration *decl, IRState *p);
|
||
|
||
// defined in ddmd/typinf.d:
|
||
Type *getTypeInfoType(Type *t, Scope *sc);
|
||
bool isSpeculativeType(Type *t);
|
||
|
||
#endif
|