Path: blob/main/contrib/llvm-project/llvm/lib/ExecutionEngine/JITLink/COFFDirectiveParser.h
35271 views
//===--- COFFDirectiveParser.h - JITLink coff directive parser --*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// MSVC COFF directive parser9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_EXECUTIONENGINE_JITLINK_COFFDIRECTIVEPARSER_H13#define LLVM_EXECUTIONENGINE_JITLINK_COFFDIRECTIVEPARSER_H1415#include "llvm/ExecutionEngine/JITLink/JITLink.h"16#include "llvm/Option/Arg.h"17#include "llvm/Option/ArgList.h"18#include "llvm/Support/CommandLine.h"19#include "llvm/Support/Error.h"20#include "llvm/Support/StringSaver.h"21#include "llvm/TargetParser/Triple.h"2223namespace llvm {24namespace jitlink {2526enum {27COFF_OPT_INVALID = 0,28#define OPTION(...) LLVM_MAKE_OPT_ID_WITH_ID_PREFIX(COFF_OPT_, __VA_ARGS__),29#include "COFFOptions.inc"30#undef OPTION31};3233/// Parser for the MSVC specific preprocessor directives.34/// https://docs.microsoft.com/en-us/cpp/preprocessor/comment-c-cpp?view=msvc-16035class COFFDirectiveParser {36public:37Expected<opt::InputArgList> parse(StringRef Str);3839private:40llvm::BumpPtrAllocator bAlloc;41llvm::StringSaver saver{bAlloc};42};4344} // end namespace jitlink45} // end namespace llvm4647#endif // LLVM_EXECUTIONENGINE_JITLINK_COFFDIRECTIVEPARSER_H484950