Mangling: use macros instead of hard-coded swift symbol names.

This makes it easier to switch between the old and new mangling scheme.
This commit is contained in:
Erik Eckstein
2016-12-02 15:04:08 -08:00
parent 684092d7d1
commit 9f8b68ae11
12 changed files with 209 additions and 190 deletions

View File

@@ -19,6 +19,7 @@
#include "swift/AST/DiagnosticsIRGen.h"
#include "swift/AST/IRGenOptions.h"
#include "swift/Basic/Dwarf.h"
#include "swift/Basic/ManglingMacros.h"
#include "swift/ClangImporter/ClangImporter.h"
#include "swift/Runtime/RuntimeFnWrappersGen.h"
#include "swift/Runtime/Config.h"
@@ -642,8 +643,9 @@ llvm::Constant *IRGenModule::getEmptyTupleMetadata() {
if (EmptyTupleMetadata)
return EmptyTupleMetadata;
EmptyTupleMetadata =
Module.getOrInsertGlobal("_TMT_", FullTypeMetadataStructTy);
EmptyTupleMetadata = Module.getOrInsertGlobal(
MANGLE_AS_STRING(METADATA_SYM(EMPTY_TUPLE_MANGLING)),
FullTypeMetadataStructTy);
if (Triple.isOSBinFormatCOFF())
cast<llvm::GlobalVariable>(EmptyTupleMetadata)
->setDLLStorageClass(llvm::GlobalValue::DLLImportStorageClass);