blob: b4a0f615f36ac0b3bd99ac2cf8aa8557d686c788 [file] [log] [blame]
Bill Wendling2c79ecb2012-09-26 21:07:29 +00001//===-- AttributesImpl.h - Attributes Internals -----------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines various helper methods and classes used by LLVMContextImpl
11// for creating and managing attributes.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_ATTRIBUTESIMPL_H
16#define LLVM_ATTRIBUTESIMPL_H
17
18#include "llvm/ADT/FoldingSet.h"
19
20namespace llvm {
21
Bill Wendling8e635db2012-10-08 21:47:17 +000022class Attributes;
Bill Wendling2c79ecb2012-09-26 21:07:29 +000023
Bill Wendling8e635db2012-10-08 21:47:17 +000024class AttributesImpl : public FoldingSetNode {
Bill Wendling8e635db2012-10-08 21:47:17 +000025 uint64_t Bits; // FIXME: We will be expanding this.
Bill Wendling2c79ecb2012-09-26 21:07:29 +000026public:
27 AttributesImpl(uint64_t bits) : Bits(bits) {}
28
Bill Wendling8e635db2012-10-08 21:47:17 +000029 bool hasAttribute(uint64_t A) const;
Bill Wendling67658342012-10-09 07:45:08 +000030
Bill Wendling8e635db2012-10-08 21:47:17 +000031 bool hasAttributes() const;
32 bool hasAttributes(const Attributes &A) const;
33
34 uint64_t getAlignment() const;
35 uint64_t getStackAlignment() const;
36
Bill Wendling925bcb12012-10-16 05:57:28 +000037 uint64_t Raw() const { return Bits; } // FIXME: Remove.
38
Bill Wendling2e879bc2012-10-09 09:11:20 +000039 static uint64_t getAttrMask(uint64_t Val);
40
Bill Wendling2c79ecb2012-09-26 21:07:29 +000041 void Profile(FoldingSetNodeID &ID) const {
42 Profile(ID, Bits);
43 }
44 static void Profile(FoldingSetNodeID &ID, uint64_t Bits) {
45 ID.AddInteger(Bits);
46 }
47};
48
49} // end llvm namespace
50
51#endif