forked from OSchip/llvm-project
all filevar's have static storage. Previously a global with
extern storage class was returning false from hasStaticStorage. Ted, please review this. llvm-svn: 44515
This commit is contained in:
parent
39aeb4069b
commit
6311b58000
|
@ -304,8 +304,8 @@ public:
|
|||
// function) that lack a storage keyword are implicitly "static,"
|
||||
// but are represented internally with a storage class of "None".
|
||||
bool hasStaticStorage() const {
|
||||
return getStorageClass() == Static ||
|
||||
(getStorageClass() == None && getKind() == FileVar);
|
||||
if (getStorageClass() == Static) return true;
|
||||
return getKind() == FileVar;
|
||||
}
|
||||
|
||||
// hasLocalStorage - Returns true if a variable with function scope
|
||||
|
|
|
@ -8,3 +8,8 @@ int myArray[5] = {1, 2, 3, 4, 5};
|
|||
int *myPointer2 = myArray;
|
||||
int *myPointer = &(myArray[2]);
|
||||
|
||||
|
||||
extern int x;
|
||||
void *g = &x;
|
||||
int *h = &x;
|
||||
|
||||
|
|
Loading…
Reference in New Issue