aboutsummaryrefslogtreecommitdiff
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/docs/QualGroup.rst15
-rw-r--r--llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h8
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp12
-rw-r--r--llvm/test/DebugInfo/Generic/compileunit-source-language-name.ll9
-rw-r--r--llvm/unittests/ExecutionEngine/Orc/SymbolStringPoolTest.cpp10
5 files changed, 51 insertions, 3 deletions
diff --git a/llvm/docs/QualGroup.rst b/llvm/docs/QualGroup.rst
index b45f569..5c05e4e 100644
--- a/llvm/docs/QualGroup.rst
+++ b/llvm/docs/QualGroup.rst
@@ -75,6 +75,16 @@ They meet the criteria for inclusion below. Knowing their handles help us keep t
- capitan-davide
- capitan_davide
- capitan-davide
+ * - Jorge Pinto Sousa
+ - Critical Techworks
+ - sousajo-cc
+ - sousajo-cc
+ - sousajo-cc
+ * - José Rui Simões
+ - Critical Software
+ - jr-simoes
+ - jr_simoes
+ - iznogoud-zz
* - Oscar Slotosch
- Validas
- slotosch
@@ -100,6 +110,11 @@ They meet the criteria for inclusion below. Knowing their handles help us keep t
- YoungJunLee
- YoungJunLee
- IamYJLee
+ * - Zaky Hermawan
+ - No Affiliation
+ - ZakyHermawan
+ - quarkz99
+ - zakyHermawan
Organizations are limited to three representatives within the group to maintain diversity.
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h b/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
index ed6ea96..2dd5abe 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/SymbolStringPool.h
@@ -14,6 +14,7 @@
#define LLVM_EXECUTIONENGINE_ORC_SYMBOLSTRINGPOOL_H
#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/Compiler.h"
#include <atomic>
@@ -71,6 +72,7 @@ private:
/// from nullptr to enable comparison with these values.
class SymbolStringPtrBase {
friend class SymbolStringPool;
+ friend class SymbolStringPoolEntryUnsafe;
friend struct DenseMapInfo<SymbolStringPtr>;
friend struct DenseMapInfo<NonOwningSymbolStringPtr>;
@@ -204,7 +206,7 @@ public:
SymbolStringPoolEntryUnsafe(PoolEntry *E) : E(E) {}
/// Create an unsafe pool entry ref without changing the ref-count.
- static SymbolStringPoolEntryUnsafe from(const SymbolStringPtr &S) {
+ static SymbolStringPoolEntryUnsafe from(const SymbolStringPtrBase &S) {
return S.S;
}
@@ -318,6 +320,10 @@ SymbolStringPool::getRefCount(const SymbolStringPtrBase &S) const {
LLVM_ABI raw_ostream &operator<<(raw_ostream &OS,
const SymbolStringPtrBase &Sym);
+inline hash_code hash_value(const orc::SymbolStringPtrBase &S) {
+ return hash_value(orc::SymbolStringPoolEntryUnsafe::from(S).rawPtr());
+}
+
} // end namespace orc
template <>
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index aa078f3..e40fb76 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -704,9 +704,17 @@ void DwarfUnit::addType(DIE &Entity, const DIType *Ty,
addDIEEntry(Entity, Attribute, DIEEntry(*getOrCreateTypeDIE(Ty)));
}
+// FIXME: change callsites to use the new DW_LNAME_ language codes.
llvm::dwarf::SourceLanguage DwarfUnit::getSourceLanguage() const {
- return static_cast<llvm::dwarf::SourceLanguage>(
- getLanguage().getUnversionedName());
+ const auto &Lang = getLanguage();
+
+ if (!Lang.hasVersionedName())
+ return static_cast<llvm::dwarf::SourceLanguage>(Lang.getName());
+
+ return llvm::dwarf::toDW_LANG(
+ static_cast<llvm::dwarf::SourceLanguageName>(Lang.getName()),
+ Lang.getVersion())
+ .value_or(llvm::dwarf::DW_LANG_hi_user);
}
std::string DwarfUnit::getParentContextString(const DIScope *Context) const {
diff --git a/llvm/test/DebugInfo/Generic/compileunit-source-language-name.ll b/llvm/test/DebugInfo/Generic/compileunit-source-language-name.ll
index 211a7bc..e2b6167 100644
--- a/llvm/test/DebugInfo/Generic/compileunit-source-language-name.ll
+++ b/llvm/test/DebugInfo/Generic/compileunit-source-language-name.ll
@@ -4,6 +4,11 @@
@x = global i32 0, align 4, !dbg !0
+; Function Attrs: mustprogress noinline nounwind optnone ssp uwtable(sync)
+define void @_Z4funcv() !dbg !8 {
+ ret void, !dbg !11
+}
+
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!6, !7}
@@ -15,3 +20,7 @@
!5 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!6 = !{i32 7, !"Dwarf Version", i32 5}
!7 = !{i32 2, !"Debug Info Version", i32 3}
+!8 = distinct !DISubprogram(name: "func", linkageName: "_Z4funcv", scope: !3, file: !3, line: 2, type: !9, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2)
+!9 = !DISubroutineType(types: !10)
+!10 = !{null}
+!11 = !DILocation(line: 2, column: 14, scope: !8)
diff --git a/llvm/unittests/ExecutionEngine/Orc/SymbolStringPoolTest.cpp b/llvm/unittests/ExecutionEngine/Orc/SymbolStringPoolTest.cpp
index cd1cecd..698dda1 100644
--- a/llvm/unittests/ExecutionEngine/Orc/SymbolStringPoolTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/SymbolStringPoolTest.cpp
@@ -180,4 +180,14 @@ TEST_F(SymbolStringPoolTest, SymbolStringPoolEntryUnsafe) {
EXPECT_EQ(getRefCount(A), 1U);
}
+TEST_F(SymbolStringPoolTest, Hashing) {
+ auto A = SP.intern("a");
+ auto B = NonOwningSymbolStringPtr(A);
+
+ hash_code AHash = hash_value(A);
+ hash_code BHash = hash_value(B);
+
+ EXPECT_EQ(AHash, BHash);
+}
+
} // namespace