[llvm-commits] CVS: llvm/tools/llvm-extract/llvm-extract.cpp
Anton Korobeynikov
asl at math.spbu.ru
Sun Jan 28 05:32:16 PST 2007
Changes in directory llvm/tools/llvm-extract:
llvm-extract.cpp updated: 1.33 -> 1.34
---
Log message:
Propagate changes from my local tree. This patch includes:
1. New parameter attribute called 'inreg'. It has meaning "place this
parameter in registers, if possible". This is some generalization of
gcc's regparm(n) attribute. It's currently used only in X86-32 backend.
2. Completely rewritten CC handling/lowering code inside X86 backend.
Merged stdcall + c CCs and fastcall + fast CC.
3. Dropped CSRET CC. We cannot add struct return variant for each
target-specific CC (e.g. stdcall + csretcc and so on).
4. Instead of CSRET CC introduced 'sret' parameter attribute. Setting in
on first attribute has meaning 'This is hidden pointer to structure
return. Handle it gently'.
5. Fixed small bug in llvm-extract + add new feature to
FunctionExtraction pass, which relinks all internal-linkaged callees
from deleted function to external linkage. This will allow further
linking everything together.
NOTEs: 1. Documentation will be updated soon.
2. llvm-upgrade should be improved to translate csret => sret.
Before this, there will be some unexpected test fails.
---
Diffs of the changes: (+7 -2)
llvm-extract.cpp | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
Index: llvm/tools/llvm-extract/llvm-extract.cpp
diff -u llvm/tools/llvm-extract/llvm-extract.cpp:1.33 llvm/tools/llvm-extract/llvm-extract.cpp:1.34
--- llvm/tools/llvm-extract/llvm-extract.cpp:1.33 Wed Dec 6 19:30:31 2006
+++ llvm/tools/llvm-extract/llvm-extract.cpp Sun Jan 28 07:31:35 2007
@@ -42,6 +42,10 @@
static cl::opt<bool>
DeleteFn("delete", cl::desc("Delete specified function from Module"));
+static cl::opt<bool>
+Relink("relink",
+ cl::desc("Turn external linkage for callees of function to delete"));
+
// ExtractFunc - The function to extract from the module... defaults to main.
static cl::opt<std::string>
ExtractFunc("func", cl::desc("Specify function to extract"), cl::init("main"),
@@ -72,8 +76,9 @@
PassManager Passes;
Passes.add(new TargetData(M.get())); // Use correct TargetData
// Either isolate the function or delete it from the Module
- Passes.add(createFunctionExtractionPass(F, DeleteFn));
- Passes.add(createGlobalDCEPass()); // Delete unreachable globals
+ Passes.add(createFunctionExtractionPass(F, DeleteFn, Relink));
+ if (!DeleteFn)
+ Passes.add(createGlobalDCEPass()); // Delete unreachable globals
Passes.add(createFunctionResolvingPass()); // Delete prototypes
Passes.add(createDeadTypeEliminationPass()); // Remove dead types...
More information about the llvm-commits
mailing list