forked from OSchip/llvm-project
Add ASTContext::MakeIntValue
- Makes an APSInt given a uint64_t and a type, with the appropriate width and signedness to match the type. Yay for functional over imperative. llvm-svn: 64863
This commit is contained in:
parent
970f245439
commit
1acc629bfd
|
@ -615,6 +615,18 @@ public:
|
|||
void Emit(llvm::Serializer& S) const;
|
||||
static ASTContext* Create(llvm::Deserializer& D);
|
||||
|
||||
//===--------------------------------------------------------------------===//
|
||||
// Integer Values
|
||||
//===--------------------------------------------------------------------===//
|
||||
|
||||
/// MakeIntValue - Make an APSInt of the appropriate width and
|
||||
/// signedness for the given \arg Value and integer \arg Type.
|
||||
llvm::APSInt MakeIntValue(uint64_t Value, QualType Type) {
|
||||
llvm::APSInt Res(getIntWidth(Type), !Type->isSignedIntegerType());
|
||||
Res = Value;
|
||||
return Res;
|
||||
}
|
||||
|
||||
private:
|
||||
ASTContext(const ASTContext&); // DO NOT IMPLEMENT
|
||||
void operator=(const ASTContext&); // DO NOT IMPLEMENT
|
||||
|
|
Loading…
Reference in New Issue