// Copyright 2018 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef TOOLS_CLANG_PLUGINS_UTIL_H_ #define TOOLS_CLANG_PLUGINS_UTIL_H_ #include #include "clang/AST/DeclBase.h" #include "clang/Basic/SourceLocation.h" #include "clang/Frontend/CompilerInstance.h" // Utility method for subclasses to determine the namespace of the // specified record, if any. Unnamed namespaces will be identified as // "". std::string GetNamespace(const clang::Decl* record); // Attempts to determine the filename for the given SourceLocation. // Returns an empty string if the filename could not be determined. std::string GetFilename(clang::CompilerInstance& instance, clang::SourceLocation location); #endif // TOOLS_CLANG_PLUGINS_UTIL_H_