Fix global variable code to correctly handle extern declarations.

When we have an "extern" global, now we no longer inadvertently define
storage for it.  Further, we now successfully do define storage when we
encounter a definition following one or more extern declarations.

Issues #215 and #217.
This commit is contained in:
Matt Pharr
2012-03-28 14:15:49 -07:00
parent 540fc6c2f3
commit 5b2d43f665
6 changed files with 101 additions and 32 deletions

2
sym.h
View File

@@ -75,7 +75,7 @@ public:
std::string MangledName() const;
SourcePos pos; /*!< Source file position where the symbol was defined */
const std::string name; /*!< Symbol's name */
std::string name; /*!< Symbol's name */
llvm::Value *storagePtr; /*!< For symbols with storage associated with
them (i.e. variables but not functions),
this member stores a pointer to its