Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit ece6cb3

Browse files
lucenticusjkotas
authored andcommitted
Change verbatim ELF.h and Dwarf.h LLVM headers to be able to build in CoreCLR + add license header (#6389)
1 parent 0d2a0d2 commit ece6cb3

File tree

3 files changed

+142
-118
lines changed

3 files changed

+142
-118
lines changed

src/inc/llvm/Dwarf.def

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,51 @@
1-
//===- llvm/Support/Dwarf.def - Dwarf definitions ---------------*- C++ -*-===//
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
// ==============================================================================
6+
// LLVM Release License
7+
// ==============================================================================
8+
// University of Illinois/NCSA
9+
// Open Source License
10+
//
11+
// Copyright (c) 2003-2015 University of Illinois at Urbana-Champaign.
12+
// All rights reserved.
13+
//
14+
// Developed by:
15+
//
16+
// LLVM Team
17+
//
18+
// University of Illinois at Urbana-Champaign
219
//
3-
// The LLVM Compiler Infrastructure
20+
// http://llvm.org
421
//
5-
// This file is distributed under the University of Illinois Open Source
6-
// License. See LICENSE.TXT for details.
22+
// Permission is hereby granted, free of charge, to any person obtaining a copy of
23+
// this software and associated documentation files (the "Software"), to deal with
24+
// the Software without restriction, including without limitation the rights to
25+
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
26+
// of the Software, and to permit persons to whom the Software is furnished to do
27+
// so, subject to the following conditions:
728
//
29+
// * Redistributions of source code must retain the above copyright notice,
30+
// this list of conditions and the following disclaimers.
31+
//
32+
// * Redistributions in binary form must reproduce the above copyright notice,
33+
// this list of conditions and the following disclaimers in the
34+
// documentation and/or other materials provided with the distribution.
35+
//
36+
// * Neither the names of the LLVM Team, University of Illinois at
37+
// Urbana-Champaign, nor the names of its contributors may be used to
38+
// endorse or promote products derived from this Software without specific
39+
// prior written permission.
40+
//
41+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
43+
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44+
// CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
47+
// SOFTWARE.
48+
849
//===----------------------------------------------------------------------===//
950
//
1051
// Macros for running through Dwarf enumerators.

src/inc/llvm/Dwarf.h

Lines changed: 50 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,51 @@
1-
//===-- llvm/Support/Dwarf.h ---Dwarf Constants------------------*- C++ -*-===//
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
// ==============================================================================
6+
// LLVM Release License
7+
// ==============================================================================
8+
// University of Illinois/NCSA
9+
// Open Source License
210
//
3-
// The LLVM Compiler Infrastructure
11+
// Copyright (c) 2003-2015 University of Illinois at Urbana-Champaign.
12+
// All rights reserved.
413
//
5-
// This file is distributed under the University of Illinois Open Source
6-
// License. See LICENSE.TXT for details.
14+
// Developed by:
715
//
16+
// LLVM Team
17+
//
18+
// University of Illinois at Urbana-Champaign
19+
//
20+
// http://llvm.org
21+
//
22+
// Permission is hereby granted, free of charge, to any person obtaining a copy of
23+
// this software and associated documentation files (the "Software"), to deal with
24+
// the Software without restriction, including without limitation the rights to
25+
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
26+
// of the Software, and to permit persons to whom the Software is furnished to do
27+
// so, subject to the following conditions:
28+
//
29+
// * Redistributions of source code must retain the above copyright notice,
30+
// this list of conditions and the following disclaimers.
31+
//
32+
// * Redistributions in binary form must reproduce the above copyright notice,
33+
// this list of conditions and the following disclaimers in the
34+
// documentation and/or other materials provided with the distribution.
35+
//
36+
// * Neither the names of the LLVM Team, University of Illinois at
37+
// Urbana-Champaign, nor the names of its contributors may be used to
38+
// endorse or promote products derived from this Software without specific
39+
// prior written permission.
40+
//
41+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
43+
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44+
// CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
47+
// SOFTWARE.
48+
849
//===----------------------------------------------------------------------===//
950
//
1051
// \file
@@ -20,14 +61,6 @@
2061
#ifndef LLVM_SUPPORT_DWARF_H
2162
#define LLVM_SUPPORT_DWARF_H
2263

23-
#include "llvm/ADT/StringRef.h"
24-
#include "llvm/Support/Compiler.h"
25-
#include "llvm/Support/DataTypes.h"
26-
27-
namespace llvm {
28-
29-
namespace dwarf {
30-
3164
//===----------------------------------------------------------------------===//
3265
// Dwarf constants as gleaned from the DWARF Debugging Information Format V.4
3366
// reference manual http://www.dwarfstd.org/.
@@ -56,7 +89,7 @@ const uint64_t DW64_CIE_ID = UINT64_MAX;
5689

5790
enum Tag : uint16_t {
5891
#define HANDLE_DW_TAG(ID, NAME) DW_TAG_##NAME = ID,
59-
#include "llvm/Support/Dwarf.def"
92+
#include "Dwarf.def"
6093
DW_TAG_lo_user = 0x4080,
6194
DW_TAG_hi_user = 0xffff,
6295
DW_TAG_user_base = 0x1000 // Recommended base for user tags.
@@ -322,14 +355,14 @@ enum Form : uint16_t {
322355

323356
enum LocationAtom {
324357
#define HANDLE_DW_OP(ID, NAME) DW_OP_##NAME = ID,
325-
#include "llvm/Support/Dwarf.def"
358+
#include "Dwarf.def"
326359
DW_OP_lo_user = 0xe0,
327360
DW_OP_hi_user = 0xff
328361
};
329362

330363
enum TypeKind {
331364
#define HANDLE_DW_ATE(ID, NAME) DW_ATE_##NAME = ID,
332-
#include "llvm/Support/Dwarf.def"
365+
#include "Dwarf.def"
333366
DW_ATE_lo_user = 0x80,
334367
DW_ATE_hi_user = 0xff
335368
};
@@ -368,13 +401,13 @@ enum VisibilityAttribute {
368401

369402
enum VirtualityAttribute {
370403
#define HANDLE_DW_VIRTUALITY(ID, NAME) DW_VIRTUALITY_##NAME = ID,
371-
#include "llvm/Support/Dwarf.def"
404+
#include "Dwarf.def"
372405
DW_VIRTUALITY_max = 0x02
373406
};
374407

375408
enum SourceLanguage {
376409
#define HANDLE_DW_LANG(ID, NAME) DW_LANG_##NAME = ID,
377-
#include "llvm/Support/Dwarf.def"
410+
#include "Dwarf.def"
378411
DW_LANG_lo_user = 0x8000,
379412
DW_LANG_hi_user = 0xffff
380413
};
@@ -638,24 +671,6 @@ const char *GDBIndexEntryKindString(GDBIndexEntryKind Kind);
638671
const char *GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage);
639672
/// @}
640673

641-
/// \defgroup DwarfConstantsParsing Dwarf constants parsing functions
642-
///
643-
/// These functions map their strings back to the corresponding enumeration
644-
/// value or return 0 if there is none, except for these exceptions:
645-
///
646-
/// \li \a getTag() returns \a DW_TAG_invalid on invalid input.
647-
/// \li \a getVirtuality() returns \a DW_VIRTUALITY_invalid on invalid input.
648-
/// \li \a getMacinfo() returns \a DW_MACINFO_invalid on invalid input.
649-
///
650-
/// @{
651-
unsigned getTag(StringRef TagString);
652-
unsigned getOperationEncoding(StringRef OperationEncodingString);
653-
unsigned getVirtuality(StringRef VirtualityString);
654-
unsigned getLanguage(StringRef LanguageString);
655-
unsigned getAttributeEncoding(StringRef EncodingString);
656-
unsigned getMacinfo(StringRef MacinfoString);
657-
/// @}
658-
659674
/// \brief Returns the symbolic string representing Val when used as a value
660675
/// for attribute Attr.
661676
const char *AttributeValueString(uint16_t Attr, unsigned Val);
@@ -693,8 +708,4 @@ struct PubIndexEntryDescriptor {
693708
};
694709
};
695710

696-
} // End of namespace dwarf
697-
698-
} // End of namespace llvm
699-
700711
#endif

0 commit comments

Comments
 (0)