LLVM 22.0.0git
LVSourceLanguage.cpp
Go to the documentation of this file.
1//===-- LVSourceLanguage.cpp ----------------------------------------------===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements LVSourceLanguage.
10//
11//===----------------------------------------------------------------------===//
12
16
17using namespace llvm;
18using namespace llvm::logicalview;
19
21 if (!isValid())
22 return {};
23 switch (getTag()) {
25 return llvm::dwarf::LanguageString(getLang());
27 static auto LangNames = llvm::codeview::getSourceLanguageNames();
28 return LangNames[getLang()].Name;
29 }
30 default:
31 llvm_unreachable("Unsupported language");
32 }
33}
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
LLVM_ABI StringRef LanguageString(unsigned Language)
Definition: Dwarf.cpp:412
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVM_ABI ArrayRef< EnumEntry< SourceLanguage > > getSourceLanguageNames()
Definition: EnumTables.cpp:491
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
static constexpr unsigned TagDwarf
static constexpr unsigned TagCodeView
LLVM_ABI StringRef getName() const