diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-07-26 23:06:27 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-07-26 23:06:27 +0000 |
commit | 9384400d83d7894b8db6756cb7f9ea573ec3ab87 (patch) | |
tree | 4c26315db66a00f9a9542f963da2aa05b2beb6e1 | |
parent | 23a21c19d9a39c04a50e4fa0cd0351b81fe59a1d (diff) | |
download | llvm-9384400d83d7894b8db6756cb7f9ea573ec3ab87.zip llvm-9384400d83d7894b8db6756cb7f9ea573ec3ab87.tar.gz llvm-9384400d83d7894b8db6756cb7f9ea573ec3ab87.tar.bz2 |
Fix for bug 840. Only use noinline attribute if gcc version >= 3.4
llvm-svn: 29311
-rw-r--r-- | llvm/utils/TableGen/DAGISelEmitter.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/DAGISelEmitter.cpp b/llvm/utils/TableGen/DAGISelEmitter.cpp index d088b2f..8a62ed8 100644 --- a/llvm/utils/TableGen/DAGISelEmitter.cpp +++ b/llvm/utils/TableGen/DAGISelEmitter.cpp @@ -3363,11 +3363,9 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) { } CallerCode += ");"; CalleeCode += ") "; -#ifdef __GNUC__ // Prevent emission routines from being inlined to reduce selection // routines stack frame sizes. - CalleeCode += "__attribute__((noinline)) "; -#endif + CalleeCode += "NOINLINE "; CalleeCode += "{\n" + CalleeDecls; for (int j = LastPred+1; j < CodeSize; ++j) CalleeCode += " " + GeneratedCode[j].second + '\n'; @@ -3632,6 +3630,11 @@ void DAGISelEmitter::run(std::ostream &OS) { << "// *** instruction selector class. These functions are really " << "methods.\n\n"; + OS << "#if defined(__GNUC__) && \\\n"; + OS << " ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4)))\n"; + OS << "#define NOINLINE __attribute__((noinline))\n"; + OS << "#endif\n\n"; + OS << "// Instance var to keep track of multiply used nodes that have \n" << "// already been selected.\n" << "std::map<SDOperand, SDOperand> CodeGenMap;\n"; |