[llvm-commits] [llvm] r84795 - in /llvm/trunk: docs/LangRef.html include/llvm/InlineAsm.h lib/AsmParser/LLLexer.cpp lib/AsmParser/LLParser.cpp lib/AsmParser/LLToken.h lib/Bitcode/Reader/BitcodeReader.cpp lib/Bitcode/Writer/BitcodeWriter.cpp lib/VMCore/AsmWriter.cpp lib/VMCore/Core.cpp lib/VMCore/InlineAsm.cpp
Dale Johannesen
dalej at apple.com
Wed Oct 21 16:28:00 PDT 2009
Author: johannes
Date: Wed Oct 21 18:28:00 2009
New Revision: 84795
URL: http://llvm.org/viewvc/llvm-project?rev=84795&view=rev
Log:
Rename msasm to alignstack per review.
Modified:
llvm/trunk/docs/LangRef.html
llvm/trunk/include/llvm/InlineAsm.h
llvm/trunk/lib/AsmParser/LLLexer.cpp
llvm/trunk/lib/AsmParser/LLParser.cpp
llvm/trunk/lib/AsmParser/LLToken.h
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/trunk/lib/VMCore/AsmWriter.cpp
llvm/trunk/lib/VMCore/Core.cpp
llvm/trunk/lib/VMCore/InlineAsm.cpp
Modified: llvm/trunk/docs/LangRef.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.html?rev=84795&r1=84794&r2=84795&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.html (original)
+++ llvm/trunk/docs/LangRef.html Wed Oct 21 18:28:00 2009
@@ -2339,9 +2339,9 @@
a special value. This value represents the inline assembler as a string
(containing the instructions to emit), a list of operand constraints (stored
as a string), a flag that indicates whether or not the inline asm
- expression has side effects, and a flag indicating whether the asm came
- originally from an asm block. An example inline assembler
- expression is:</p>
+ expression has side effects, and a flag indicating whether the function
+ containing the asm needs to align its stack conservatively. An example
+ inline assembler expression is:</p>
<div class="doc_code">
<pre>
@@ -2369,12 +2369,16 @@
</pre>
</div>
-<p>Inline asms derived from asm blocks are similarly marked with the
- '<tt>msasm</tt>' keyword:</p>
+<p>In some cases inline asms will contain code that will not work unless the
+ stack is aligned in some way, such as calls or SSE instructions on x86,
+ yet will not contain code that does that alignment within the asm.
+ The compiler should make conservative assumptions about what the asm might
+ contain and should generate its usual stack alignment code in the prologue
+ if the '<tt>alignstack</tt>' keyword is present:</p>
<div class="doc_code">
<pre>
-call void asm msasm "eieio", ""()
+call void asm alignstack "eieio", ""()
</pre>
</div>
Modified: llvm/trunk/include/llvm/InlineAsm.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InlineAsm.h?rev=84795&r1=84794&r2=84795&view=diff
==============================================================================
--- llvm/trunk/include/llvm/InlineAsm.h (original)
+++ llvm/trunk/include/llvm/InlineAsm.h Wed Oct 21 18:28:00 2009
@@ -31,11 +31,11 @@
std::string AsmString, Constraints;
bool HasSideEffects;
- bool IsMsAsm;
+ bool IsAlignStack;
InlineAsm(const FunctionType *Ty, const StringRef &AsmString,
const StringRef &Constraints, bool hasSideEffects,
- bool isMsAsm = false);
+ bool isAlignStack = false);
virtual ~InlineAsm();
public:
@@ -43,10 +43,10 @@
///
static InlineAsm *get(const FunctionType *Ty, const StringRef &AsmString,
const StringRef &Constraints, bool hasSideEffects,
- bool isMsAsm = false);
+ bool isAlignStack = false);
bool hasSideEffects() const { return HasSideEffects; }
- bool isMsAsm() const { return IsMsAsm; }
+ bool isAlignStack() const { return IsAlignStack; }
/// getType - InlineAsm's are always pointers.
///
Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=84795&r1=84794&r2=84795&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLLexer.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLLexer.cpp Wed Oct 21 18:28:00 2009
@@ -529,7 +529,7 @@
KEYWORD(module);
KEYWORD(asm);
KEYWORD(sideeffect);
- KEYWORD(msasm);
+ KEYWORD(alignstack);
KEYWORD(gc);
KEYWORD(ccc);
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=84795&r1=84794&r2=84795&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Wed Oct 21 18:28:00 2009
@@ -1974,17 +1974,17 @@
return false;
case lltok::kw_asm: {
- // ValID ::= 'asm' SideEffect? MsAsm? STRINGCONSTANT ',' STRINGCONSTANT
- bool HasSideEffect, MsAsm;
+ // ValID ::= 'asm' SideEffect? AlignStack? STRINGCONSTANT ',' STRINGCONSTANT
+ bool HasSideEffect, AlignStack;
Lex.Lex();
if (ParseOptionalToken(lltok::kw_sideeffect, HasSideEffect) ||
- ParseOptionalToken(lltok::kw_msasm, MsAsm) ||
+ ParseOptionalToken(lltok::kw_alignstack, AlignStack) ||
ParseStringConstant(ID.StrVal) ||
ParseToken(lltok::comma, "expected comma in inline asm expression") ||
ParseToken(lltok::StringConstant, "expected constraint string"))
return true;
ID.StrVal2 = Lex.getStrVal();
- ID.UIntVal = HasSideEffect | ((unsigned)MsAsm<<1);
+ ID.UIntVal = HasSideEffect | ((unsigned)AlignStack<<1);
ID.Kind = ValID::t_InlineAsm;
return false;
}
Modified: llvm/trunk/lib/AsmParser/LLToken.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLToken.h?rev=84795&r1=84794&r2=84795&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLToken.h (original)
+++ llvm/trunk/lib/AsmParser/LLToken.h Wed Oct 21 18:28:00 2009
@@ -62,7 +62,7 @@
kw_module,
kw_asm,
kw_sideeffect,
- kw_msasm,
+ kw_alignstack,
kw_gc,
kw_c,
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=84795&r1=84794&r2=84795&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Wed Oct 21 18:28:00 2009
@@ -1165,7 +1165,7 @@
if (Record.size() < 2) return Error("Invalid INLINEASM record");
std::string AsmStr, ConstrStr;
bool HasSideEffects = Record[0] & 1;
- bool IsMsAsm = Record[0] >> 1;
+ bool IsAlignStack = Record[0] >> 1;
unsigned AsmStrSize = Record[1];
if (2+AsmStrSize >= Record.size())
return Error("Invalid INLINEASM record");
@@ -1179,7 +1179,7 @@
ConstrStr += (char)Record[3+AsmStrSize+i];
const PointerType *PTy = cast<PointerType>(CurTy);
V = InlineAsm::get(cast<FunctionType>(PTy->getElementType()),
- AsmStr, ConstrStr, HasSideEffects, IsMsAsm);
+ AsmStr, ConstrStr, HasSideEffects, IsAlignStack);
break;
}
}
Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=84795&r1=84794&r2=84795&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Wed Oct 21 18:28:00 2009
@@ -678,7 +678,7 @@
if (const InlineAsm *IA = dyn_cast<InlineAsm>(V)) {
Record.push_back(unsigned(IA->hasSideEffects()) |
- unsigned(IA->isMsAsm()) << 1);
+ unsigned(IA->isAlignStack()) << 1);
// Add the asm string.
const std::string &AsmStr = IA->getAsmString();
Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=84795&r1=84794&r2=84795&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Wed Oct 21 18:28:00 2009
@@ -1205,8 +1205,8 @@
Out << "asm ";
if (IA->hasSideEffects())
Out << "sideeffect ";
- if (IA->isMsAsm())
- Out << "msasm ";
+ if (IA->isAlignStack())
+ Out << "alignstack ";
Out << '"';
PrintEscapedString(IA->getAsmString(), Out);
Out << "\", \"";
Modified: llvm/trunk/lib/VMCore/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=84795&r1=84794&r2=84795&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Core.cpp (original)
+++ llvm/trunk/lib/VMCore/Core.cpp Wed Oct 21 18:28:00 2009
@@ -885,9 +885,9 @@
LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty, const char *AsmString,
const char *Constraints, int HasSideEffects,
- int IsMsAsm) {
+ int IsAlignStack) {
return wrap(InlineAsm::get(dyn_cast<FunctionType>(unwrap(Ty)), AsmString,
- Constraints, HasSideEffects, IsMsAsm));
+ Constraints, HasSideEffects, IsAlignStack));
}
/*--.. Operations on global variables, functions, and aliases (globals) ....--*/
Modified: llvm/trunk/lib/VMCore/InlineAsm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/InlineAsm.cpp?rev=84795&r1=84794&r2=84795&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/InlineAsm.cpp (original)
+++ llvm/trunk/lib/VMCore/InlineAsm.cpp Wed Oct 21 18:28:00 2009
@@ -28,18 +28,20 @@
InlineAsm *InlineAsm::get(const FunctionType *Ty, const StringRef &AsmString,
const StringRef &Constraints, bool hasSideEffects,
- bool isMsAsm) {
+ bool isAlignStack) {
// FIXME: memoize!
- return new InlineAsm(Ty, AsmString, Constraints, hasSideEffects, isMsAsm);
+ return new InlineAsm(Ty, AsmString, Constraints, hasSideEffects,
+ isAlignStack);
}
InlineAsm::InlineAsm(const FunctionType *Ty, const StringRef &asmString,
const StringRef &constraints, bool hasSideEffects,
- bool isMsAsm)
+ bool isAlignStack)
: Value(PointerType::getUnqual(Ty),
Value::InlineAsmVal),
AsmString(asmString),
- Constraints(constraints), HasSideEffects(hasSideEffects), IsMsAsm(isMsAsm) {
+ Constraints(constraints), HasSideEffects(hasSideEffects),
+ IsAlignStack(isAlignStack) {
// Do various checks on the constraint string and type.
assert(Verify(Ty, constraints) && "Function type not legal for constraints!");
More information about the llvm-commits
mailing list