[llvm-commits] [PATCH] Move the LowerMEMCPY and LowerMEMCPYCall to a common place

Bill Wendling isanbard at gmail.com
Mon Nov 5 11:06:47 PST 2007


Hi Rafael,

> The attached patch passes a "make check". I haven't committed yet
> because I am going on vacations and will be a bit slow to respond. I
> will still have Internet access and can commit if there is positive
> feedback.
>
Index: include/llvm/Target/TargetLowering.h
===================================================================
--- include/llvm/Target/TargetLowering.h	(revision 43703)
+++ include/llvm/Target/TargetLowering.h	(working copy)
@@ -22,6 +22,7 @@
 #ifndef LLVM_TARGET_TARGETLOWERING_H
 #define LLVM_TARGET_TARGETLOWERING_H

+#include "llvm/Target/TargetSubtarget.h"
 #include "llvm/CodeGen/SelectionDAGNodes.h"

You probably can get away with forward declaring the TargetSubtarget
class instead of #including here.

> One ugly hack in the CL in to make "Subtarget" and "BaseSubtarget"
> independent fields that point to the same object. I did this just to
> make the type checker happy. Is there an easier way to merge them then
> adding virtual getters to the base class and replacing all uses of
> Subtarget?
>
If you're going to do this, why not just get rid of Subtarget
altogether and just use BaseSubtarget? It can be set to 0 for targets
that don't use it. Then again, it might not be a bad idea to use
virtual getter/setters here. It already has virtual functions, and
you're calling virtual functions through this pointer. So... :-)

-bw



More information about the llvm-commits mailing list