aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/CBackend/CBackend.cpp
diff options
context:
space:
mode:
authorLauro Ramos Venancio <lauro.venancio@gmail.com>2007-07-11 19:56:53 +0000
committerLauro Ramos Venancio <lauro.venancio@gmail.com>2007-07-11 19:56:53 +0000
commita126bb71d5ba119fcddabfe022fad9647b9f1bf0 (patch)
tree655fdca330a9e12be2735f7b30cdb2fde9259601 /lib/Target/CBackend/CBackend.cpp
parent02e2152d02b6463c33e4462c849c604a9be0c9c5 (diff)
Handle packed structs in the CBackend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39752 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CBackend/CBackend.cpp')
-rw-r--r--lib/Target/CBackend/CBackend.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 91f427fa2c..b0c76c8e8e 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -466,7 +466,10 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
printType(Out, *I, false, "field" + utostr(Idx++));
Out << ";\n";
}
- return Out << '}';
+ Out << '}';
+ if (STy->isPacked())
+ Out << " __attribute__ ((packed))";
+ return Out;
}
case Type::PointerTyID: {