Mercurial > projects > ldc
comparison gen/irstate.h @ 971:985104c0f1db
Fix the problems exposed by the callingconv1.d test case.
The first was that unless otherwise specified, inputs are assumed to be in
registers even if they specify a "matching output" that's in memory.
While testing that fix, I also ran into a bug causing the generated "matching
output" for any input was always the first one instead of the correct one.
author | Frits van Bommel <fvbommel wxs.nl> |
---|---|
date | Tue, 17 Feb 2009 00:08:20 +0100 |
parents | 7e669954db7d |
children | 2667e3a145be |
comparison
equal
deleted
inserted
replaced
970:fb31a4afa2df | 971:985104c0f1db |
---|---|
79 | 79 |
80 struct IRAsmBlock | 80 struct IRAsmBlock |
81 { | 81 { |
82 std::deque<IRAsmStmt*> s; | 82 std::deque<IRAsmStmt*> s; |
83 std::set<std::string> clobs; | 83 std::set<std::string> clobs; |
84 size_t outputcount; | |
84 | 85 |
85 // stores the labels within the asm block | 86 // stores the labels within the asm block |
86 std::vector<Identifier*> internalLabels; | 87 std::vector<Identifier*> internalLabels; |
87 | 88 |
88 AsmBlockStatement* asmBlock; | 89 AsmBlockStatement* asmBlock; |
90 unsigned retn; | 91 unsigned retn; |
91 bool retemu; // emulate abi ret with a temporary | 92 bool retemu; // emulate abi ret with a temporary |
92 LLValue* (*retfixup)(IRBuilderHelper b, LLValue* orig); // Modifies retval | 93 LLValue* (*retfixup)(IRBuilderHelper b, LLValue* orig); // Modifies retval |
93 | 94 |
94 IRAsmBlock(AsmBlockStatement* b) | 95 IRAsmBlock(AsmBlockStatement* b) |
95 : asmBlock(b), retty(NULL), retn(0), retemu(false), retfixup(NULL) {} | 96 : asmBlock(b), retty(NULL), retn(0), retemu(false), retfixup(NULL), |
97 outputcount(0) | |
98 {} | |
96 }; | 99 }; |
97 | 100 |
98 // llvm::CallInst and llvm::InvokeInst don't share a common base | 101 // llvm::CallInst and llvm::InvokeInst don't share a common base |
99 // but share common functionality. to avoid duplicating code for | 102 // but share common functionality. to avoid duplicating code for |
100 // adjusting these common properties these structs are made | 103 // adjusting these common properties these structs are made |