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:
Chris Lattner 2007-12-02 07:47:49 +00:00
parent 39aeb4069b
commit 6311b58000
2 changed files with 7 additions and 2 deletions

View File

@ -304,8 +304,8 @@ public:
// function) that lack a storage keyword are implicitly "static," // function) that lack a storage keyword are implicitly "static,"
// but are represented internally with a storage class of "None". // but are represented internally with a storage class of "None".
bool hasStaticStorage() const { bool hasStaticStorage() const {
return getStorageClass() == Static || if (getStorageClass() == Static) return true;
(getStorageClass() == None && getKind() == FileVar); return getKind() == FileVar;
} }
// hasLocalStorage - Returns true if a variable with function scope // hasLocalStorage - Returns true if a variable with function scope

View File

@ -8,3 +8,8 @@ int myArray[5] = {1, 2, 3, 4, 5};
int *myPointer2 = myArray; int *myPointer2 = myArray;
int *myPointer = &(myArray[2]); int *myPointer = &(myArray[2]);
extern int x;
void *g = &x;
int *h = &x;