#include "clang/Basic/LLVM.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/Support/PointerLikeTypeTraits.h"
#include <cassert>
#include <cstdint>
#include <string>
static void Profile(const clang::SourceLocation &X, FoldingSetNodeID &ID);
};
- // Teach SmallPtrSet how to handle SourceLocation.
- template<>
- struct PointerLikeTypeTraits<clang::SourceLocation> {
- static constexpr int NumLowBitsAvailable = 0;
-
- static void *getAsVoidPointer(clang::SourceLocation L) {
- return L.getPtrEncoding();
- }
-
- static clang::SourceLocation getFromVoidPointer(void *P) {
- return clang::SourceLocation::getFromRawEncoding((unsigned)(uintptr_t)P);
- }
- };
-
} // namespace llvm
#endif // LLVM_CLANG_BASIC_SOURCELOCATION_H
/// deserializing from PCH, we don't need to deserialize identifier & macros
/// just so that we can report that they are unused, we just warn using
/// the SourceLocations of this set (that will be filled by the ASTReader).
- /// We are using SmallPtrSet instead of a vector for faster removal.
- using WarnUnusedMacroLocsTy = llvm::SmallPtrSet<SourceLocation, 32>;
+ using WarnUnusedMacroLocsTy = llvm::SmallDenseSet<SourceLocation, 32>;
WarnUnusedMacroLocsTy WarnUnusedMacroLocs;
/// A "freelist" of MacroArg objects that can be