ldc/gen/linkage.h
Martin Kinkelin da7f8787c3 Handle IR collisions wrt. built-in TypeInfos and make them mutable
Compiling the rt.util.typeinfo unittests leads to base-typed forward
declarations of built-in TypeInfos colliding with the init symbols for
their TypeInfo_* classes in rt.util.typeinfo.

We've already had a workaround for this in one place (typinf.cpp);
extend it to the other side as well (iraggr.cpp).

Also make sure to emit the TypeInfo metadata even if the IR symbol
already exists as init symbol.

And finally, keep init symbols of built-in TypeInfo classes mutable just
like any other TypeInfo, so that e.g. synchronized() can be used on the
implicit monitor.
2020-10-25 17:06:16 +01:00

22 lines
679 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//===-- gen/linkage.h - Common linkage types --------------------*- C++ -*-===//
//
// LDC the LLVM D compiler
//
// This file is distributed under the BSD-style LDC license. See the LICENSE
// file for details.
//
//===----------------------------------------------------------------------===//
//
// Linkage types used for certain constructs (templates, TypeInfo).
//
//===----------------------------------------------------------------------===//
#pragma once
#include "gen/llvm.h"
// Make it easier to test new linkage types
#define TYPEINFO_LINKAGE_TYPE LLGlobalValue::LinkOnceODRLinkage
extern LLGlobalValue::LinkageTypes templateLinkage;