summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCParser/AsmParser.cpp
diff options
context:
space:
mode:
authorJan Wen Voung <jvoung@google.com>2010-10-04 17:32:41 +0000
committerJan Wen Voung <jvoung@google.com>2010-10-04 17:32:41 +0000
commit87f77b5f9a5654490cef338ae9f13703b915168e (patch)
tree242c3ab65b821a1972dce6be26aecb15207e13e9 /llvm/lib/MC/MCParser/AsmParser.cpp
parent0d9c993401bd557b0c5953a4e6fdf4d79f5a52bc (diff)
downloadbcm5719-llvm-87f77b5f9a5654490cef338ae9f13703b915168e.tar.gz
bcm5719-llvm-87f77b5f9a5654490cef338ae9f13703b915168e.zip
Add hook in MCSection to decide when to use "optimized nops", for each
section kind. Previously, optimized nops were only used for MachO. Also added tests for ELF and COFF. llvm-svn: 115523
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmParser.cpp')
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index fbac34a15ea..688827d2c76 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -1654,12 +1654,7 @@ bool AsmParser::ParseDirectiveAlign(bool IsPow2, unsigned ValueSize) {
// Check whether we should use optimal code alignment for this .align
// directive.
- //
- // FIXME: This should be using a target hook.
- bool UseCodeAlign = false;
- if (const MCSectionMachO *S = dyn_cast<MCSectionMachO>(
- getStreamer().getCurrentSection()))
- UseCodeAlign = S->hasAttribute(MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS);
+ bool UseCodeAlign = getStreamer().getCurrentSection()->UseCodeAlign();
if ((!HasFillExpr || Lexer.getMAI().getTextAlignFillValue() == FillExpr) &&
ValueSize == 1 && UseCodeAlign) {
getStreamer().EmitCodeAlignment(Alignment, MaxBytesToFill);
OpenPOWER on IntegriCloud