forked from OSchip/llvm-project
Add VarDecl::getStorageClassSpecifierString (StorageClass -> const char*).
- No functionality change. llvm-svn: 69019
This commit is contained in:
parent
b866ce73b2
commit
b76b745707
|
@ -221,6 +221,13 @@ public:
|
|||
enum StorageClass {
|
||||
None, Auto, Register, Extern, Static, PrivateExtern
|
||||
};
|
||||
|
||||
/// getStorageClassSpecifierString - Return the string used to
|
||||
/// specify the storage class \arg SC.
|
||||
///
|
||||
/// It is illegal to call this function with SC == None.
|
||||
static const char *getStorageClassSpecifierString(StorageClass SC);
|
||||
|
||||
private:
|
||||
Stmt *Init;
|
||||
// FIXME: This can be packed into the bitfields in Decl.
|
||||
|
|
|
@ -60,6 +60,20 @@ ImplicitParamDecl *ImplicitParamDecl::Create(ASTContext &C, DeclContext *DC,
|
|||
return new (C) ImplicitParamDecl(ImplicitParam, DC, L, Id, T);
|
||||
}
|
||||
|
||||
const char *VarDecl::getStorageClassSpecifierString(StorageClass SC) {
|
||||
switch (SC) {
|
||||
case VarDecl::None: break;
|
||||
case VarDecl::Auto: return "auto"; break;
|
||||
case VarDecl::Extern: return "extern"; break;
|
||||
case VarDecl::PrivateExtern: return "__private_extern__"; break;
|
||||
case VarDecl::Register: return "register"; break;
|
||||
case VarDecl::Static: return "static"; break;
|
||||
}
|
||||
|
||||
assert(0 && "Invalid storage class");
|
||||
return 0;
|
||||
}
|
||||
|
||||
ParmVarDecl *ParmVarDecl::Create(ASTContext &C, DeclContext *DC,
|
||||
SourceLocation L, IdentifierInfo *Id,
|
||||
QualType T, StorageClass S,
|
||||
|
|
Loading…
Reference in New Issue