[NFC] Extract helper for making magic identifier strings

This commit is contained in:
Brent Royal-Gordon
2020-01-21 10:50:03 -08:00
parent 171e12fd1a
commit 6c99bdac1e
3 changed files with 17 additions and 22 deletions

View File

@@ -1049,6 +1049,20 @@ public:
enum Kind : unsigned {
File, FilePath, Line, Column, Function, DSOHandle
};
static StringRef getKindString(MagicIdentifierLiteralExpr::Kind value) {
switch (value) {
case File: return "#file";
case FilePath: return "#filePath";
case Function: return "#function";
case Line: return "#line";
case Column: return "#column";
case DSOHandle: return "#dsohandle";
}
llvm_unreachable("Unhandled MagicIdentifierLiteralExpr in getKindString.");
}
private:
SourceLoc Loc;
ConcreteDeclRef BuiltinInitializer;