[LLVMdev] Segmented Stacks (re-roll)

Sanjoy Das sanjoy at playingwithpointers.com
Tue Aug 23 09:24:32 PDT 2011


Hi!

> diff --git a/lib/CodeGen/StackSegmenter.cpp b/lib/CodeGen/StackSegmenter.cpp
> new file mode 100644
> index 0000000..5ffb8f2
> --- /dev/null
> +++ b/lib/CodeGen/StackSegmenter.cpp
> @@ -0,0 +1,48 @@
> +//===-- StackSegmenter.h - Prolog/Epilog code insertion -------*- C++ -* --===//
> 
> The comment is obviously incorrect.

Thanks.  So much for lifting file headers. :)

> 
> diff --git a/lib/CodeGen/StackSegmenter.h b/lib/CodeGen/StackSegmenter.h
> new file mode 100644
> index 0000000..1284532
> --- /dev/null
> +++ b/lib/CodeGen/StackSegmenter.h
> @@ -0,0 +1,43 @@
> +//===-- StackSegmenter.h - Prolog/Epilog code insertion -------*- C++ -* --===//
> 
> Please write comment that clearly indicates what the pass would do.

Will do.

> A bigger question is why is StackSegmenter.{h|cpp} are for? It's empty as far as I can tell.

In the `Prologue code emission for X86.', I modify this pass to emit
segmented stacks code before function prologues (by calling a function
in X86FrameLowering).  I organized the code this way since it seemed
more elegant than checking for a flag inside the corresponding
emitPrologue.

-- 
Sanjoy Das
http://playingwithpointers.com



More information about the llvm-dev mailing list