LLVM 23.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 return llvm::codeview::getSourceLanguageNames().toString(getLang());
28 default:
29 llvm_unreachable("Unsupported language");
30 }
31}
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
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 EnumStrings< SourceLanguage, 1 > getSourceLanguageNames()
This is an optimization pass for GlobalISel generic memory operations.
static constexpr unsigned TagDwarf
static constexpr unsigned TagCodeView
LLVM_ABI StringRef getName() const