blob: e7b122de1bba52fcd8fa933075728089092a3d6b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
//===-- LVSourceLanguage.cpp ----------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file implements LVSourceLanguage.
//
//===----------------------------------------------------------------------===//
#include "llvm/DebugInfo/LogicalView/Core/LVSourceLanguage.h"
#include "llvm/DebugInfo/CodeView/EnumTables.h"
#include "llvm/Support/ScopedPrinter.h"
using namespace llvm;
using namespace llvm::logicalview;
StringRef LVSourceLanguage::getName() const {
if (!isValid())
return {};
switch (getTag()) {
case LVSourceLanguage::TagDwarf:
return llvm::dwarf::LanguageString(getLang());
case LVSourceLanguage::TagCodeView: {
static auto LangNames = llvm::codeview::getSourceLanguageNames();
return LangNames[getLang()].Name;
}
default:
llvm_unreachable("Unsupported language");
}
}
|