summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/CBackend
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2006-09-14 18:23:27 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2006-09-14 18:23:27 +0000
commitd61d39ec53110fdd148c33925e389abff528b481 (patch)
treed472b468851ea4e3a4700c6d626fb1049cbbf29a /llvm/lib/Target/CBackend
parent616aa548b2739719ac53e01bdd620c9372aa6567 (diff)
downloadbcm5719-llvm-d61d39ec53110fdd148c33925e389abff528b481.tar.gz
bcm5719-llvm-d61d39ec53110fdd148c33925e389abff528b481.zip
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. llvm-svn: 30374
Diffstat (limited to 'llvm/lib/Target/CBackend')
-rw-r--r--llvm/lib/Target/CBackend/Writer.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/Target/CBackend/Writer.cpp b/llvm/lib/Target/CBackend/Writer.cpp
index 330a7bc53f8..2aa36270bf2 100644
--- a/llvm/lib/Target/CBackend/Writer.cpp
+++ b/llvm/lib/Target/CBackend/Writer.cpp
@@ -1054,7 +1054,11 @@ bool CWriter::doInitialization(Module &M) {
Out << "extern ";
printType(Out, I->getType()->getElementType(), Mang->getValueName(I));
Out << ";\n";
- }
+ } else if (I->hasDLLImportLinkage()) {
+ Out << "__declspec(dllimport) ";
+ printType(Out, I->getType()->getElementType(), Mang->getValueName(I));
+ Out << ";\n";
+ }
}
}
@@ -1118,6 +1122,11 @@ bool CWriter::doInitialization(Module &M) {
if (I->hasInternalLinkage())
Out << "static ";
+ else if (I->hasDLLImportLinkage())
+ Out << "__declspec(dllimport) ";
+ else if (I->hasDLLExportLinkage())
+ Out << "__declspec(dllexport) ";
+
printType(Out, I->getType()->getElementType(), Mang->getValueName(I));
if (I->hasLinkOnceLinkage())
Out << " __attribute__((common))";
@@ -1267,6 +1276,8 @@ void CWriter::printFunctionSignature(const Function *F, bool Prototype) {
bool isCStructReturn = F->getCallingConv() == CallingConv::CSRet;
if (F->hasInternalLinkage()) Out << "static ";
+ if (F->hasDLLImportLinkage()) Out << "__declspec(dllimport) ";
+ if (F->hasDLLExportLinkage()) Out << "__declspec(dllexport) ";
// Loop over the arguments, printing them...
const FunctionType *FT = cast<FunctionType>(F->getFunctionType());
OpenPOWER on IntegriCloud