Skip to content

Commit 2546406

Browse files
committed
[cxx-interop][nfc] Remove internal header dependency on runtime/stdlib/shims.
The internal compiler headers should not include swift shim headers. Removing this dependency allows libSwift to import Swift compiler headers (otherwise, we get name conflics, because we import SwiftShims headers twice: from the source includes and build includes).
1 parent 8259242 commit 2546406

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

include/swift/Demangling/Demangle.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#define SWIFT_DEMANGLING_DEMANGLE_H
2121

2222
#include "swift/Demangling/NamespaceMacros.h"
23-
#include "swift/Runtime/Config.h"
2423
#include "llvm/ADT/StringRef.h"
24+
#include "llvm/Support/Compiler.h"
2525
#include <cassert>
2626
#include <cstdint>
2727
#include <memory>
@@ -514,7 +514,7 @@ enum class OperatorKind {
514514
};
515515

516516
/// A mangling error, which consists of an error code and a Node pointer
517-
struct SWIFT_NODISCARD ManglingError {
517+
struct LLVM_NODISCARD ManglingError {
518518
enum Code {
519519
Success = 0,
520520
AssertionFailed,
@@ -556,7 +556,7 @@ struct SWIFT_NODISCARD ManglingError {
556556

557557
/// Used as a return type for mangling functions that may fail
558558
template <typename T>
559-
class SWIFT_NODISCARD ManglingErrorOr {
559+
class LLVM_NODISCARD ManglingErrorOr {
560560
private:
561561
ManglingError err_;
562562
T value_;

lib/Demangling/Demangler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
//
1515
//===----------------------------------------------------------------------===//
1616

17+
#include "llvm/Support/Compiler.h"
1718
#include "swift/Demangling/Demangler.h"
1819
#include "DemanglerAssert.h"
1920
#include "swift/Demangling/ManglingMacros.h"
@@ -90,7 +91,7 @@ static bool isRequirement(Node::Kind kind) {
9091
// Public utility functions //
9192
//////////////////////////////////
9293

93-
SWIFT_NORETURN void swift::Demangle::failAssert(const char *file, unsigned line,
94+
LLVM_NODISCARD void swift::Demangle::failAssert(const char *file, unsigned line,
9495
NodePointer node,
9596
const char *expr) {
9697
fprintf(stderr, "%s:%u: assertion failed for Node %p: %s", file, line, node,

lib/Demangling/DemanglerAssert.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#ifndef SWIFT_DEMANGLING_ASSERT_H
1919
#define SWIFT_DEMANGLING_ASSERT_H
2020

21+
#include "llvm/Support/Compiler.h"
2122
#include "swift/Demangling/Demangle.h"
2223
#include "swift/Demangling/NamespaceMacros.h"
2324

@@ -50,7 +51,7 @@ namespace swift {
5051
namespace Demangle {
5152
SWIFT_BEGIN_INLINE_NAMESPACE
5253

53-
SWIFT_NORETURN void failAssert(const char *file, unsigned line,
54+
LLVM_NODISCARD void failAssert(const char *file, unsigned line,
5455
NodePointer node, const char *expr);
5556

5657
SWIFT_END_INLINE_NAMESPACE

0 commit comments

Comments
 (0)