Adding dllimport, dllexport and external weak linkage types.

DLL* linkages got full (I hope) codegeneration support in C & both x86
assembler backends.
External weak linkage added for future use, we don't provide any
codegeneration, etc. support for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30374 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov
2006-09-14 18:23:27 +00:00
parent a17cf0a7e2
commit b74ed07bfd
30 changed files with 477 additions and 103 deletions
+2 -2
View File
@@ -1245,7 +1245,7 @@ static Constant *getVal(std::map<Value*, Constant*> &ComputedValues,
static bool isSimpleEnoughPointerToCommit(Constant *C) {
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C)) {
if (!GV->hasExternalLinkage() && !GV->hasInternalLinkage())
return false; // do not allow weak/linkonce linkage.
return false; // do not allow weak/linkonce/dllimport/dllexport linkage.
return !GV->isExternal(); // reject external globals.
}
if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C))
@@ -1254,7 +1254,7 @@ static bool isSimpleEnoughPointerToCommit(Constant *C) {
isa<GlobalVariable>(CE->getOperand(0))) {
GlobalVariable *GV = cast<GlobalVariable>(CE->getOperand(0));
if (!GV->hasExternalLinkage() && !GV->hasInternalLinkage())
return false; // do not allow weak/linkonce linkage.
return false; // do not allow weak/linkonce/dllimport/dllexport linkage.
return GV->hasInitializer() &&
ConstantFoldLoadThroughGEPConstantExpr(GV->getInitializer(), CE);
}