1 //===- DefinedAtom.cpp ------------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "llvm/Support/ErrorHandling.h"
10 #include "lld/Core/DefinedAtom.h"
11 #include "lld/Core/File.h"
15 DefinedAtom::ContentPermissions DefinedAtom::permissions() const {
16 // By default base permissions on content type.
17 return permissions(this->contentType());
20 // Utility function for deriving permissions from content type
21 DefinedAtom::ContentPermissions DefinedAtom::permissions(ContentType type) {
25 case typeBranchIsland:
41 case typeCompactUnwindInfo:
42 case typeProcessedUnwindInfo:
43 case typeObjCImageInfo:
44 case typeObjCMethodList:
50 case typeZeroFillFast:
53 case typeLazyDylibPointer:
54 case typeNonLazyPointer:
61 case typeInitializerPtr:
62 case typeTerminatorPtr:
64 case typeObjCClassPtr:
65 case typeObjC2CategoryList:
66 case typeInterposingTuples:
67 case typeTLVInitialData:
68 case typeTLVInitialZeroFill:
69 case typeTLVInitializerPtr:
78 llvm_unreachable("unknown content type");