[llvm-commits] PIC Codegen for Linux/X86. llvm-gcc patch

2007-01-06 Thread Anton Korobeynikov
Hello, Everyone.

Attached patch will allow llvm-gcc correctly generate PIC code, when
-fPIC flag is supplied (surely, the PIC codegen patch for LLVM itself
should be applied as well)

-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics & Mechanics, Saint Petersburg State University.

diff -r 1c6f13454195 gcc/config/i386/linux.h
--- a/gcc/config/i386/linux.h	Thu Jan 04 10:47:31 2007 +
+++ b/gcc/config/i386/linux.h	Sat Jan 06 15:05:34 2007 +0300
@@ -185,3 +185,16 @@ Boston, MA 02111-1307, USA.  */
 
 /* This macro may be overridden in i386/k*bsd-gnu.h.  */
 #define REG_NAME(reg) reg
+
+/* APPLE LOCAL begin LLVM */
+#ifdef ENABLE_LLVM
+
+/* Yes, we're supporting PIC codegen for X86-Linux-ELF target! */
+
+#define LLVM_SET_TARGET_OPTIONS(argvec)  \
+  if (flag_pic)  \
+argvec.push_back ("--relocation-model=pic"); \
+  else   \
+argvec.push_back ("--relocation-model=static")
+#endif
+/* APPLE LOCAL end LLVM */
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp

2007-01-06 Thread Anton Korobeynikov


Changes in directory llvm/lib/Target/X86:

X86ATTAsmPrinter.cpp updated: 1.81 -> 1.82
---
Log message:

gcc often inserts it's own names for sections (e.g. 
gnu.linkonce.t.FunctionName). Convert them to "normal" LLVM names, 
otherwise linker won't be able to merge them.


---
Diffs of the changes:  (+7 -2)

 X86ATTAsmPrinter.cpp |9 +++--
 1 files changed, 7 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.81 
llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.82
--- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.81   Wed Jan  3 05:43:14 2007
+++ llvm/lib/Target/X86/X86ATTAsmPrinter.cppSat Jan  6 12:24:26 2007
@@ -80,8 +80,13 @@
 
   X86SharedAsmPrinter::decorateName(CurrentFnName, F);
 
-  SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
-  
+  // Change GNU linkonce to LLVM linkonce name
+  if (F->hasSection() &&
+  (F->getSection().find(".gnu.linkonce.t") != std::string::npos))
+SwitchToTextSection(getSectionForFunction(*F).c_str(), NULL);
+  else
+SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+
   switch (F->getLinkage()) {
   default: assert(0 && "Unknown linkage type!");
   case Function::InternalLinkage:  // Symbols default to internal.



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

2007-01-06 Thread Reid Spencer
Chris,

I believe this patch has broken these two instcombine tests:

FAIL: 
/proj/llvm/llvm-3/test/Regression/Transforms/InstCombine/2003-11-13-ConstExprCastCall.ll:
child process exited abnormally
call i32 (...)* bitcast (void (i8*)* %free to i32 (...)*)( i32* 
%X.pntr.s1.u0 ) ; :0 [#uses=0]

FAIL: 
/proj/llvm/llvm-3/test/Regression/Transforms/InstCombine/call-cast-target.ll:
child process exited abnormally
%tmp.s = call i32 bitcast (i8* (i32*)* %ctime to i32 (i32*)*)( i32* 
null )  ;  [#uses=1]

Both of them are checking to see if the bitcast is gone which isn't the case 
any more.

Reid.

On Fri, 2007-01-05 at 20:09 -0600, Chris Lattner wrote:
> 
> Changes in directory llvm/lib/Transforms/Scalar:
> 
> InstructionCombining.cpp updated: 1.582 -> 1.583
> ---
> Log message:
> 
> simplify some more code now that there are not multiple different integer
> types of the same size
> 
> 
> ---
> Diffs of the changes:  (+4 -8)
> 
>  InstructionCombining.cpp |   12 
>  1 files changed, 4 insertions(+), 8 deletions(-)
> 
> 
> Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
> diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.582 
> llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.583
> --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.582 Fri Jan  5 
> 19:45:59 2007
> +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp   Fri Jan  5 
> 20:09:32 2007
> @@ -7211,13 +7211,9 @@
>  
>// Check to see if we are changing the return type...
>if (OldRetTy != FT->getReturnType()) {
> -if (Callee->isExternal() &&
> -!Caller->use_empty() && 
> -!(OldRetTy->canLosslesslyBitCastTo(FT->getReturnType()) ||
> -  (isa(FT->getReturnType()) && 
> -   TD->getIntPtrType()->canLosslesslyBitCastTo(OldRetTy)))
> -)
> -  return false;   // Cannot transform this return value...
> +if (Callee->isExternal() && !Caller->use_empty() && 
> +OldRetTy != FT->getReturnType())
> +  return false;   // Cannot transform this return value.
>  
>  // If the callsite is an invoke instruction, and the return value is 
> used by
>  // a PHI node in a successor, we cannot change the return type of the 
> call
> @@ -7242,7 +7238,7 @@
>  const Type *ActTy = (*AI)->getType();
>  ConstantInt *c = dyn_cast(*AI);
>  //Either we can cast directly, or we can upconvert the argument
> -bool isConvertible = ActTy->canLosslesslyBitCastTo(ParamTy) ||
> +bool isConvertible = ActTy == ParamTy ||
>(ParamTy->isIntegral() && ActTy->isIntegral() &&
> ParamTy->getPrimitiveSize() >= ActTy->getPrimitiveSize()) ||
>(c && ParamTy->getPrimitiveSize() >= ActTy->getPrimitiveSize() &&
> 
> 
> 
> ___
> llvm-commits mailing list
> llvm-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

2007-01-06 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.584 -> 1.585
---
Log message:

Fix regressions in InstCombine/call-cast-target.ll and 
InstCombine/2003-11-13-ConstExprCastCall.ll


---
Diffs of the changes:  (+5 -1)

 InstructionCombining.cpp |6 +-
 1 files changed, 5 insertions(+), 1 deletion(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.584 
llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.585
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.584   Fri Jan  5 
20:11:56 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sat Jan  6 13:53:32 2007
@@ -7208,7 +7208,10 @@
   // Check to see if we are changing the return type...
   if (OldRetTy != FT->getReturnType()) {
 if (Callee->isExternal() && !Caller->use_empty() && 
-OldRetTy != FT->getReturnType())
+OldRetTy != FT->getReturnType() &&
+// Conversion is ok if changing from pointer to int of same size.
+!(isa(FT->getReturnType()) &&
+  TD->getIntPtrType() == OldRetTy))
   return false;   // Cannot transform this return value.
 
 // If the callsite is an invoke instruction, and the return value is used 
by
@@ -7235,6 +7238,7 @@
 ConstantInt *c = dyn_cast(*AI);
 //Either we can cast directly, or we can upconvert the argument
 bool isConvertible = ActTy == ParamTy ||
+  (isa(ParamTy) && isa(ActTy)) ||
   (ParamTy->isIntegral() && ActTy->isIntegral() &&
ParamTy->getPrimitiveSize() >= ActTy->getPrimitiveSize()) ||
   (c && ParamTy->getPrimitiveSize() >= ActTy->getPrimitiveSize() &&



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

2007-01-06 Thread Chris Lattner

On Jan 6, 2007, at 9:51 AM, Reid Spencer wrote:
> I believe this patch has broken these two instcombine tests:
>
> FAIL: /proj/llvm/llvm-3/test/Regression/Transforms/InstCombine/ 
> 2003-11-13-ConstExprCastCall.ll:
> FAIL: /proj/llvm/llvm-3/test/Regression/Transforms/InstCombine/call- 
> cast-target.ll:
> Both of them are checking to see if the bitcast is gone which isn't  
> the case any more.

You're right.  Passing tests doesn't mean much if I type 'make' in  
lib/Transforms/Scalar instead of at the top level. :(

Sorry for the breakage,

-Chris
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] patch for PR1084

2007-01-06 Thread Chris Lattner
GCC is making type-inconsistent trees when forming globals with  
pointers to methods in them.  This handles it.


-Chris

Index: llvm-convert.cpp
===
--- llvm-convert.cpp(revision 122082)
+++ llvm-convert.cpp(working copy)
@@ -4415,6 +4415,11 @@
   const Type *Ty = ConvertType(TREE_TYPE(exp));
   bool EltIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_OPERAND(exp, 0)));
   bool TyIsSigned = !TYPE_UNSIGNED(TREE_TYPE(exp));
+  
+  // If this is a structure-to-structure cast, just return the uncasted value.
+  if (!Elt->getType()->isFirstClassType() || !Ty->isFirstClassType())
+return Elt;
+  
   // Elt and Ty can be integer, float or pointer here: need generalized cast
   Instruction::CastOps opcode = CastInst::getCastOpcode(Elt, EltIsSigned,
 Ty, TyIsSigned);
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] llvm-gcc patch for pr1083

2007-01-06 Thread Chris Lattner

This fixes PR1083 and test/Regression/CFrontend/2007-01-06-KNR-Proto.c

Index: llvm-convert.cpp
===
--- llvm-convert.cpp(revision 122081)
+++ llvm-convert.cpp(working copy)
@@ -209,14 +209,20 @@
 void HandleScalarArgument(const llvm::Type *LLVMTy, tree type) {
   Value *ArgVal = AI;
   if (ArgVal->getType() != LLVMTy) {
-// If this is just a mismatch between integer types, this could be due
-// to K&R prototypes, where the forward proto defines the arg as int 
and
-// the actual impls is a short or char.
-assert(ArgVal->getType()->isIntegral() && LLVMTy->isIntegral() &&
-   "Lowerings don't match?");
-bool isSigned = type == 0 ? true : !TYPE_UNSIGNED(type);
-ArgVal = CastInst::createIntegerCast(ArgVal, LLVMTy, isSigned,
- NameStack.back(), CurBB);
+if (isa(ArgVal->getType()) && isa(LLVMTy)) {
+  // If this is GCC being sloppy about pointer types, insert a bitcast.
+  // See PR1083 for an example.
+  ArgVal = new BitCastInst(ArgVal, LLVMTy, "tmp", CurBB);
+} else {
+  // If this is just a mismatch between integer types, this could be 
due
+  // to K&R prototypes, where the forward proto defines the arg as int
+  // and the actual impls is a short or char.
+  assert(ArgVal->getType()->isIntegral() && LLVMTy->isIntegral() &&
+ "Lowerings don't match?");
+  bool isSigned = type == 0 ? true : !TYPE_UNSIGNED(type);
+  ArgVal = CastInst::createIntegerCast(ArgVal, LLVMTy, isSigned,
+   NameStack.back(), CurBB);
+}
   }
   assert(!LocStack.empty());
   Value *Loc = LocStack.back();


-Chris___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp

2007-01-06 Thread Chris Lattner
> gcc often inserts it's own names for sections (e.g.
> gnu.linkonce.t.FunctionName). Convert them to "normal" LLVM names,
> otherwise linker won't be able to merge them.

Can you be a bit more explicit about what this fixes?

-Chris

>
> ---
> Diffs of the changes:  (+7 -2)
>
>  X86ATTAsmPrinter.cpp |9 +++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
>
>
> Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
> diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.81 llvm/lib/ 
> Target/X86/X86ATTAsmPrinter.cpp:1.82
> --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.81 Wed Jan  3  
> 05:43:14 2007
> +++ llvm/lib/Target/X86/X86ATTAsmPrinter.cpp  Sat Jan  6 12:24:26 2007
> @@ -80,8 +80,13 @@
>
>X86SharedAsmPrinter::decorateName(CurrentFnName, F);
>
> -  SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
> -
> +  // Change GNU linkonce to LLVM linkonce name
> +  if (F->hasSection() &&
> +  (F->getSection().find(".gnu.linkonce.t") != std::string::npos))
> +SwitchToTextSection(getSectionForFunction(*F).c_str(), NULL);
> +  else
> +SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
> +
>switch (F->getLinkage()) {
>default: assert(0 && "Unknown linkage type!");
>case Function::InternalLinkage:  // Symbols default to internal.
>
>
>
> ___
> llvm-commits mailing list
> llvm-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp

2007-01-06 Thread Chris Lattner

On Jan 6, 2007, at 1:39 PM, Chris Lattner wrote:

>> gcc often inserts it's own names for sections (e.g.
>> gnu.linkonce.t.FunctionName). Convert them to "normal" LLVM names,
>> otherwise linker won't be able to merge them.
>
> Can you be a bit more explicit about what this fixes?

Okay, Anton pointed out that it's a workaround for
http://llvm.org/bugs/show_bug.cgi?id=1085

When this CFE bug is fixed, we can revert this patch.

-Chris
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] patch for pr1085

2007-01-06 Thread Chris Lattner
This fixes PR1085 on ELF systems, darwin doesn't suffer from this  
problem.


Testcase here: Regression/C++Frontend/2007-01-06-ELF-Thunk-Sections.cpp

Index: method.c
===
--- method.c(revision 122081)
+++ method.c(working copy)
@@ -390,6 +390,12 @@
   push_to_top_level ();
 
   if (TARGET_USE_LOCAL_THUNK_ALIAS_P (function)
+  /* APPLE LOCAL begin LLVM */
+  /* PR1085 */
+#ifndef ENABLE_LLVM
+  && 0
+#endif
+  /* APPLE LOCAL end LLVM */
   && targetm.have_named_sections)
 {
   resolve_unique_section (function, 0, flag_function_sections);


-Chris___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp

2007-01-06 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

IndVarSimplify.cpp updated: 1.100 -> 1.101
---
Log message:

add -debug output for -indvars.


---
Diffs of the changes:  (+19 -6)

 IndVarSimplify.cpp |   25 +++--
 1 files changed, 19 insertions(+), 6 deletions(-)


Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.100 
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.101
--- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.100 Sat Dec 30 23:48:39 2006
+++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp   Sat Jan  6 19:14:12 2007
@@ -46,6 +46,7 @@
 #include "llvm/Analysis/ScalarEvolutionExpander.h"
 #include "llvm/Analysis/LoopInfo.h"
 #include "llvm/Support/CFG.h"
+#include "llvm/Support/Debug.h"
 #include "llvm/Support/GetElementPtrTypeIterator.h"
 #include "llvm/Transforms/Utils/Local.h"
 #include "llvm/Support/CommandLine.h"
@@ -113,6 +114,7 @@
 if (Instruction *U = dyn_cast(I->getOperand(i)))
   Insts.insert(U);
   SE->deleteInstructionFromRecords(I);
+  DOUT << "INDVARS: Deleting: " << *I;
   I->eraseFromParent();
   Changed = true;
 }
@@ -133,7 +135,8 @@
   dyn_cast(PN->getIncomingValue(BackedgeIdx)))
 if (GEPI->getOperand(0) == PN) {
   assert(GEPI->getNumOperands() == 2 && "GEP types must match!");
-
+  DOUT << "INDVARS: Eliminating pointer recurrence: " << *GEPI;
+  
   // Okay, we found a pointer recurrence.  Transform this pointer
   // recurrence into an integer recurrence.  Compute the value that gets
   // added to the pointer at every iteration.
@@ -265,6 +268,9 @@
 // We have to use the preincremented value...
 IndVar = L->getCanonicalInductionVariable();
   }
+  
+  DOUT << "INDVARS: LFTR: TripCount = " << *TripCount
+   << "  IndVar = " << *IndVar << "\n";
 
   // Expand the code for the iteration count into the preheader of the loop.
   BasicBlock *Preheader = L->getLoopPreheader();
@@ -359,6 +365,9 @@
 Value *NewVal = Rewriter.expandCodeFor(ExitValue, InsertPt,
I->getType());
 
+DOUT << "INDVARS: RLEV: AfterLoopVal = " << *NewVal
+ << "  LoopVal = " << *I << "\n";
+
 // Rewrite any users of the computed value outside of the loop
 // with the newly computed value.
 for (unsigned i = 0, e = ExtraLoopUsers.size(); i != e; ++i) {
@@ -502,6 +511,7 @@
   Value *IndVar = 
Rewriter.getOrInsertCanonicalInductionVariable(L,LargestType);
   ++NumInserted;
   Changed = true;
+  DOUT << "INDVARS: New CanIV: " << *IndVar;
 
   if (!isa(IterationCount))
 if (Instruction *DI = LinearFunctionTestReplace(L, 
IterationCount,Rewriter))
@@ -523,20 +533,23 @@
   if (!InsertedSizes[IndVars[i].first->getType()->getPrimitiveSize()]) {
 PHINode *PN = IndVars[i].first;
 InsertedSizes[PN->getType()->getPrimitiveSize()] = true;
-Instruction *New = CastInst::create(Instruction::Trunc, IndVar, 
-PN->getType(), "indvar", InsertPt);
+Instruction *New = new TruncInst(IndVar, PN->getType(), "indvar",
+ InsertPt);
 Rewriter.addInsertedValue(New, SE->getSCEV(New));
+DOUT << "INDVARS: Made trunc IV for " << *PN
+ << "   NewVal = " << *New << "\n";
   }
   }
 
-  // If there were induction variables of other sizes, cast the primary
-  // induction variable to the right size for them, avoiding the need for the
-  // code evaluation methods to insert induction variables of different sizes.
+  // Rewrite all induction variables in terms of the canonical induction
+  // variable.
   std::map InsertedSizes;
   while (!IndVars.empty()) {
 PHINode *PN = IndVars.back().first;
 Value *NewVal = Rewriter.expandCodeFor(IndVars.back().second, InsertPt,
PN->getType());
+DOUT << "INDVARS: Rewrote IV '" << *IndVars.back().second << "' " << *PN
+ << "   into = " << *NewVal << "\n";
 std::string Name = PN->getName();
 PN->setName("");
 NewVal->setName(Name);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/Regression/C++Frontend/2007-01-06-ELF-Thunk-Sections.cpp

2007-01-06 Thread Chris Lattner


Changes in directory llvm/test/Regression/C++Frontend:

2007-01-06-ELF-Thunk-Sections.cpp added (r1.1)
---
Log message:

Testcase for PR1085: http://llvm.org/PR1085 


---
Diffs of the changes:  (+50 -0)

 2007-01-06-ELF-Thunk-Sections.cpp |   50 ++
 1 files changed, 50 insertions(+)


Index: llvm/test/Regression/C++Frontend/2007-01-06-ELF-Thunk-Sections.cpp
diff -c /dev/null 
llvm/test/Regression/C++Frontend/2007-01-06-ELF-Thunk-Sections.cpp:1.1
*** /dev/null   Sat Jan  6 18:32:25 2007
--- llvm/test/Regression/C++Frontend/2007-01-06-ELF-Thunk-Sections.cpp  Sat Jan 
 6 18:32:15 2007
***
*** 0 
--- 1,50 
+ // RUN: %llvmgxx %s -emit-llvm -S -o - &&
+ // RUN: %llvmgxx %s -emit-llvm -S -o - | not grep 'gnu.linkonce.'
+ // PR1085
+ 
+ class 
+ __attribute__((visibility("default"))) QGenericArgument
+ {
+   public:inline QGenericArgument(const char *aName = 0, const void *aData 
= 0):_data(aData), _name(aName) {
+   }
+   private:const void *_data;
+   const char *_name;
+ };
+ struct __attribute__ ((
+  visibility("default"))) QMetaObject
+ {
+   struct {
+   }
+   d;
+ };
+ class 
+ __attribute__((visibility("default"))) QObject
+ {
+   virtual const QMetaObject *metaObject() const;
+ };
+ class 
+ __attribute__((visibility("default"))) QPaintDevice
+ {
+   public:enum PaintDeviceMetric {
+   PdmWidth = 1, PdmHeight, PdmWidthMM, PdmHeightMM, PdmNumColors, 
PdmDepth, PdmDpiX, PdmDpiY, PdmPhysicalDpiX, PdmPhysicalDpiY
+   };
+   virtual ~ QPaintDevice();
+   union {
+   }
+   ct;
+ };
+ class 
+ __attribute__((visibility("default"))) QWidget:public QObject, public 
QPaintDevice
+ {
+ };
+ class 
+ __attribute__((visibility("default"))) QDialog:public QWidget
+ {
+ };
+ class   TopicChooser:public QDialog {
+   virtual const QMetaObject *metaObject() const;
+ };
+ const QMetaObject *TopicChooser::
+ metaObject() const
+ {
+ }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/docs/ProgrammersManual.html

2007-01-06 Thread Reid Spencer


Changes in directory llvm/docs:

ProgrammersManual.html updated: 1.101 -> 1.102
---
Log message:

Update the documentation for SymbolTable class.


---
Diffs of the changes:  (+13 -63)

 ProgrammersManual.html |   76 -
 1 files changed, 13 insertions(+), 63 deletions(-)


Index: llvm/docs/ProgrammersManual.html
diff -u llvm/docs/ProgrammersManual.html:1.101 
llvm/docs/ProgrammersManual.html:1.102
--- llvm/docs/ProgrammersManual.html:1.101  Thu Jan  4 16:01:45 2007
+++ llvm/docs/ProgrammersManual.htmlSat Jan  6 18:41:39 2007
@@ -1426,14 +1426,14 @@
 This class provides a symbol table that the Function and 
 Module classes use for naming definitions. The symbol table can
-provide a name for any Value or Type.  SymbolTable is an abstract data
-type. It hides the data it contains and provides access to it through a
-controlled interface.
-
-Note that the symbol table class is should not be directly accessed by most
-clients.  It should only be used when iteration over the symbol table names
-themselves are required, which is very special purpose.  Note that not all LLVM
+provide a name for any Value. 
+SymbolTable is an abstract data type. It hides the data it contains 
+and provides access to it through a controlled interface.
+
+Note that the SymbolTable class should not be directly accessed 
+by most clients.  It should only be used when iteration over the symbol table 
+names themselves are required, which is very special purpose.  Note that not 
+all LLVM
 Values have names, and those without names (i.e. they have
 an empty name) do not exist in the symbol table.
 
@@ -1442,9 +1442,8 @@
 structure of the information it holds. The class contains two 
 std::map objects. The first, pmap, is a map of 
 Type* to maps of name (std::string) to Value*. 
-The second, tmap, is a map of names to Type*. Thus, Values
-are stored in two-dimensions and accessed by Type and name. Types,
-however, are stored in a single dimension and accessed only by name.
+Thus, Values are stored in two-dimensions and accessed by Type and 
+name. 
 
 The interface of this class provides three basic types of operations:
 
@@ -1456,7 +1455,7 @@
   insert.
   Iterators. Iterators allow the user to traverse the content
   of the symbol table in well defined ways, such as the method
-  type_begin.
+  plane_begin.
 
 
 Accessors
@@ -1467,15 +1466,6 @@
   Ty parameter for a Value with the provided name.
   If a suitable Value is not found, null is returned.
 
-  Type* lookupType( const std::string& name) const:
-  The lookupType method searches through the types for a
-  Type with the provided name. If a suitable Type
-  is not found, null is returned.
-
-  bool hasTypes() const:
-  This function returns true if an entry has been made into the type
-  map.
-
   bool isEmpty() const:
   This function returns true if both the value and types maps are
   empty
@@ -1493,12 +1483,6 @@
   name. There can be a many to one mapping between names and constants
   or types.
 
-  void insert(const std::string& Name, Type *Typ):
-   Inserts a type into the symbol table with the specified name. There
-  can be a many-to-one mapping between names and types. This method
-  allows a type with an existing entry in the symbol table to get
-  a new name.
-
   void remove(Value* Val):
   This method removes a named value from the symbol table. The
   type and name of the Value are extracted from \p N and used to
@@ -1506,21 +1490,11 @@
   not in the symbol table, this method silently ignores the
   request.
 
-  void remove(Type* Typ):
-   This method removes a named type from the symbol table. The
-  name of the type is extracted from \P T and used to look up
-  the Type in the type map. If the Type is not in the symbol
-  table, this method silently ignores the request.
-
   Value* remove(const std::string& Name, Value *Val):
Remove a constant or type with the specified name from the 
   symbol table.
 
-  Type* remove(const std::string& Name, Type* T):
-   Remove a type with the specified name from the symbol table.
-  Returns the removed Type.
-
-  Value *value_remove(const value_iterator& It):
+  Value *remove(const value_iterator& It):
Removes a specific value from the symbol table. 
   Returns the removed value.
 
@@ -1551,16 +1525,6 @@
 
   
   
-All name/Type PairsTI
-
-for (SymbolTable::type_const_iterator TI = ST.type_begin(),
- TE = ST.type_end(); TI != TE; ++TI ) {
-  TI->first  // This is the name of the type
-  TI->second // This is the Type* value associated with the name
-}
-
-  
-  
 name/Value pairs in a planeVI
 
 for (SymbolTable::value_const_iterator VI = ST.value_begin(SomeType),
@@ -1618,20 +1582,6 @@
   marker for end of iteration of the type plane.
   Note: the type plane must already exist before using this.
 
-  type_iterator type_begin():
-  Get an iterator to the start of the name/Type map.
-
-  type_const_iterator type_begin() cons:
-   Get a

[llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp

2007-01-06 Thread Anton Korobeynikov


Changes in directory llvm/lib/Target/X86:

X86ATTAsmPrinter.cpp updated: 1.82 -> 1.83
---
Log message:

As PR1085: http://llvm.org/PR1085  was fixed, back out workaround


---
Diffs of the changes:  (+1 -6)

 X86ATTAsmPrinter.cpp |7 +--
 1 files changed, 1 insertion(+), 6 deletions(-)


Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.82 
llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.83
--- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.82   Sat Jan  6 12:24:26 2007
+++ llvm/lib/Target/X86/X86ATTAsmPrinter.cppSat Jan  6 18:41:20 2007
@@ -80,12 +80,7 @@
 
   X86SharedAsmPrinter::decorateName(CurrentFnName, F);
 
-  // Change GNU linkonce to LLVM linkonce name
-  if (F->hasSection() &&
-  (F->getSection().find(".gnu.linkonce.t") != std::string::npos))
-SwitchToTextSection(getSectionForFunction(*F).c_str(), NULL);
-  else
-SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
+  SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
 
   switch (F->getLinkage()) {
   default: assert(0 && "Unknown linkage type!");



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Support/CStringMap.cpp

2007-01-06 Thread Chris Lattner


Changes in directory llvm/lib/Support:

CStringMap.cpp updated: 1.2 -> 1.3
---
Log message:

wow, the link was already broken :)


---
Diffs of the changes:  (+1 -1)

 CStringMap.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Support/CStringMap.cpp
diff -u llvm/lib/Support/CStringMap.cpp:1.2 llvm/lib/Support/CStringMap.cpp:1.3
--- llvm/lib/Support/CStringMap.cpp:1.2 Sat Jan  6 17:19:38 2007
+++ llvm/lib/Support/CStringMap.cpp Sat Jan  6 17:20:51 2007
@@ -36,7 +36,7 @@
   // Bernstein hash function.
   unsigned int Result = 0;
   // TODO: investigate whether a modified bernstein hash function performs
-  // better: http://eternallyconfuzzled.com/tuts/hashing.html#existing
+  // better: 
http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx
   //   X*33+c -> X*33^c
   while (Start != End)
 Result = Result * 33 + *Start++;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/lto/lto.cpp

2007-01-06 Thread Chris Lattner


Changes in directory llvm/tools/lto:

lto.cpp updated: 1.27 -> 1.28
---
Log message:

fix typo


---
Diffs of the changes:  (+1 -1)

 lto.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/tools/lto/lto.cpp
diff -u llvm/tools/lto/lto.cpp:1.27 llvm/tools/lto/lto.cpp:1.28
--- llvm/tools/lto/lto.cpp:1.27 Wed Dec  6 19:30:32 2006
+++ llvm/tools/lto/lto.cpp  Sat Jan  6 17:51:31 2007
@@ -7,7 +7,7 @@
 // 
 
//===--===//
 //
-// This file implementes link time optimization library. This library is 
+// This file implements the Link Time Optimization library. This library is 
 // intended to be used by linker to optimize code at link time.
 //
 
//===--===//



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Support/CStringMap.cpp

2007-01-06 Thread Chris Lattner


Changes in directory llvm/lib/Support:

CStringMap.cpp updated: 1.1 -> 1.2
---
Log message:

add a note


---
Diffs of the changes:  (+4 -1)

 CStringMap.cpp |5 -
 1 files changed, 4 insertions(+), 1 deletion(-)


Index: llvm/lib/Support/CStringMap.cpp
diff -u llvm/lib/Support/CStringMap.cpp:1.1 llvm/lib/Support/CStringMap.cpp:1.2
--- llvm/lib/Support/CStringMap.cpp:1.1 Sun Oct 29 17:42:03 2006
+++ llvm/lib/Support/CStringMap.cpp Sat Jan  6 17:19:38 2007
@@ -33,8 +33,11 @@
 /// HashString - Compute a hash code for the specified string.
 ///
 static unsigned HashString(const char *Start, const char *End) {
+  // Bernstein hash function.
   unsigned int Result = 0;
-  // Perl hash function.
+  // TODO: investigate whether a modified bernstein hash function performs
+  // better: http://eternallyconfuzzled.com/tuts/hashing.html#existing
+  //   X*33+c -> X*33^c
   while (Start != End)
 Result = Result * 33 + *Start++;
   Result = Result + (Result >> 5);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm-c/LinkTimeOptimizer.h

2007-01-06 Thread Chris Lattner


Changes in directory llvm/include/llvm-c:

LinkTimeOptimizer.h added (r1.1)
---
Log message:

Add C wrappers for the LTO library (PR1081: http://llvm.org/PR1081 ).  Patch by 
Chandler Carruth!


---
Diffs of the changes:  (+58 -0)

 LinkTimeOptimizer.h |   58 
 1 files changed, 58 insertions(+)


Index: llvm/include/llvm-c/LinkTimeOptimizer.h
diff -c /dev/null llvm/include/llvm-c/LinkTimeOptimizer.h:1.1
*** /dev/null   Sat Jan  6 17:52:56 2007
--- llvm/include/llvm-c/LinkTimeOptimizer.h Sat Jan  6 17:52:46 2007
***
*** 0 
--- 1,58 
+ //===-- llvm/LinkTimeOptimizer.h - LTO Public C Interface ---*- C++ 
-*-===//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by Chandler Carruth and is distributed under
+ // the University of Illinois Open Source License. See LICENSE.TXT for 
details.
+ // 
+ 
//===--===//
+ //
+ // This header provides a C API to use the LLVM link time optimization
+ // library. This is inteded to be used by linkers which are C-only in
+ // their implementation for performing LTO.
+ //
+ 
//===--===//
+ 
+ #ifndef __LTO_CAPI_H__
+ #define __LTO_CAPI_H__
+ 
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+ 
+   /// This provides a dummy type for pointers to the LTO object.
+   typedef void* llvm_lto_t;
+ 
+   /// This provides a C-visible enumerator to manage status codes.
+   /// This should map exactly onto the C++ enumerator LTOStatus.
+   typedef enum llvm_lto_status {
+ LLVM_LTO_UNKNOWN,
+ LLVM_LTO_OPT_SUCCESS,
+ LLVM_LTO_READ_SUCCESS,
+ LLVM_LTO_READ_FAILURE,
+ LLVM_LTO_WRITE_FAILURE,
+ LLVM_LTO_NO_TARGET,
+ LLVM_LTO_NO_WORK,
+ LLVM_LTO_MODULE_MERGE_FAILURE,
+ LLVM_LTO_ASM_FAILURE,
+ 
+ //  Added C-specific error codes
+ LLVM_LTO_NULL_OBJECT
+   } llvm_lto_status_t;
+  
+   /// This provides C interface to initialize link time optimizer. This allows
+   /// linker to use dlopen() interface to dynamically load LinkTimeOptimizer.
+   /// extern "C" helps, because dlopen() interface uses name to find the 
symbol.
+   extern llvm_lto_t llvm_create_optimizer(void);
+   extern void llvm_destroy_optimizer(llvm_lto_t lto);
+ 
+   extern llvm_lto_status_t llvm_read_object_file
+ (llvm_lto_t lto, const char* input_filename);
+   extern llvm_lto_status_t llvm_optimize_modules
+ (llvm_lto_t lto, const char* output_filename);
+ 
+ #ifdef __cplusplus
+ }
+ #endif
+ 
+ #endif



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp

2007-01-06 Thread Chris Lattner


Changes in directory llvm/lib/Target/PowerPC:

PPCTargetMachine.cpp updated: 1.111 -> 1.112
---
Log message:

Disable the macho writer until it is 100% functional.  Enabling it when
broken invites bug reports.


---
Diffs of the changes:  (+3 -0)

 PPCTargetMachine.cpp |3 +++
 1 files changed, 3 insertions(+)


Index: llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
diff -u llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.111 
llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.112
--- llvm/lib/Target/PowerPC/PPCTargetMachine.cpp:1.111  Thu Dec 21 14:26:09 2006
+++ llvm/lib/Target/PowerPC/PPCTargetMachine.cppSat Jan  6 16:27:58 2007
@@ -131,6 +131,9 @@
 
 bool PPCTargetMachine::addObjectWriter(FunctionPassManager &PM, bool Fast,
std::ostream &Out) {
+  // FIXME: until the macho writer is 100% functional, diable this by default.
+  return true;
+  
   // FIXME: support PPC ELF files at some point
   addPPCMachOObjectWriterPass(PM, Out, *this);
   return false;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/Regression/CFrontend/2007-01-06-KNR-Proto.c

2007-01-06 Thread Chris Lattner


Changes in directory llvm/test/Regression/CFrontend:

2007-01-06-KNR-Proto.c added (r1.1)
---
Log message:

testcase for pr1083: http://llvm.org/PR1083 


---
Diffs of the changes:  (+10 -0)

 2007-01-06-KNR-Proto.c |   10 ++
 1 files changed, 10 insertions(+)


Index: llvm/test/Regression/CFrontend/2007-01-06-KNR-Proto.c
diff -c /dev/null llvm/test/Regression/CFrontend/2007-01-06-KNR-Proto.c:1.1
*** /dev/null   Sat Jan  6 17:38:47 2007
--- llvm/test/Regression/CFrontend/2007-01-06-KNR-Proto.c   Sat Jan  6 
17:38:37 2007
***
*** 0 
--- 1,10 
+ // RUN: %llvmgcc -S -o - -emit-llvm %s
+ // PR1083
+ 
+ int svc_register (void (*dispatch) (int));
+ 
+ int svc_register (dispatch)
+  void (*dispatch) ();
+ {
+ }
+ 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/Regression/Transforms/LoopSimplify/2006-08-11-LoopSimplifyLongTime.ll 2006-08-11-LoopSimplifyLongTime.ll.bc

2007-01-06 Thread Chris Lattner


Changes in directory llvm/test/Regression/Transforms/LoopSimplify:

2006-08-11-LoopSimplifyLongTime.ll (r1.1) removed
2006-08-11-LoopSimplifyLongTime.ll.bc (r1.5) removed
---
Log message:

this testcase is too large to be useful, and requires a .bc file to be 
kept around.  We can do without it.


---
Diffs of the changes:  (+0 -0)

 0 files changed



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/lto/lto-c.cpp

2007-01-06 Thread Chris Lattner


Changes in directory llvm/tools/lto:

lto-c.cpp added (r1.1)
---
Log message:

Add C wrappers for the LTO library (PR1081: http://llvm.org/PR1081 ).  Patch by 
Chandler Carruth!


---
Diffs of the changes:  (+66 -0)

 lto-c.cpp |   66 ++
 1 files changed, 66 insertions(+)


Index: llvm/tools/lto/lto-c.cpp
diff -c /dev/null llvm/tools/lto/lto-c.cpp:1.1
*** /dev/null   Sat Jan  6 17:53:53 2007
--- llvm/tools/lto/lto-c.cppSat Jan  6 17:53:43 2007
***
*** 0 
--- 1,66 
+ //===- lto-c.cpp - LLVM Link Time Optimizer C Wrappers 
===//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by Chandler Carruth and is distributed under
+ // the University of Illinois Open Source License. See LICENSE.TXT for 
details.
+ // 
+ 
//===--===//
+ //
+ // This file implements a C wrapper API for the Link Time Optimization
+ // library.
+ //
+ 
//===--===//
+ 
+ #include "llvm-c/LinkTimeOptimizer.h"
+ #include "llvm/LinkTimeOptimizer.h"
+ using namespace llvm;
+ 
+ 
+ /// Create an instance of the LLVM LTO object for performing the link
+ /// time optimizations.
+ extern "C"
+ llvm_lto_t llvm_create_optimizer() {
+   return new llvm::LTO();
+ }
+ 
+ /// Destroy an instance of the LLVM LTO object
+ extern "C"
+ void llvm_destroy_optimizer(llvm_lto_t lto) {
+   delete (llvm::LTO*)lto;
+ }
+ 
+ /// Read an LLVM bytecode file using LTO::readLLVMObjectFile.
+ extern "C"
+ llvm_lto_status
+ llvm_read_object_file(llvm_lto_t lto, const char *input_filename) {
+   llvm::LTO *l = (llvm::LTO*)lto;
+ 
+   if (input_filename == NULL)
+ return LLVM_LTO_READ_FAILURE;
+ 
+   std::string InputFilename(input_filename);
+   llvm::LTO::NameToSymbolMap symbols;
+   std::set references;
+   return (llvm_lto_status)((int)(l->readLLVMObjectFile(InputFilename, symbols,
+references)));
+ }
+ 
+ 
+ /// Optimize and output object code using LTO::optimizeModules.
+ extern "C"
+ llvm_lto_status
+ llvm_optimize_modules(llvm_lto_t lto, const char *output_filename) {
+   llvm::LTO *l = (llvm::LTO*)lto;
+ 
+   std::string OutputFilename(output_filename);
+   std::vector exportList;
+   std::string targetTriple;
+ 
+   return (llvm_lto_status)((int)(
+ l->optimizeModules(OutputFilename, exportList,
+targetTriple, false, "")));
+ }
+ 
+ 
+ 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/Regression/C++Frontend/2007-01-06-PtrMethodInit.cpp

2007-01-06 Thread Chris Lattner


Changes in directory llvm/test/Regression/C++Frontend:

2007-01-06-PtrMethodInit.cpp added (r1.1)
---
Log message:

New testcase for PR1084: http://llvm.org/PR1084 


---
Diffs of the changes:  (+75 -0)

 2007-01-06-PtrMethodInit.cpp |   75 +++
 1 files changed, 75 insertions(+)


Index: llvm/test/Regression/C++Frontend/2007-01-06-PtrMethodInit.cpp
diff -c /dev/null 
llvm/test/Regression/C++Frontend/2007-01-06-PtrMethodInit.cpp:1.1
*** /dev/null   Sat Jan  6 18:02:30 2007
--- llvm/test/Regression/C++Frontend/2007-01-06-PtrMethodInit.cpp   Sat Jan 
 6 18:02:20 2007
***
*** 0 
--- 1,75 
+ // RUN: %llvmgxx %s -emit-llvm -S -o -
+ // PR1084
+ 
+ extern "C"
+ {
+   typedef unsigned char PRUint8;
+   typedef unsigned int PRUint32;
+ }
+ typedef PRUint32 nsresult;
+ struct nsID
+ {
+ };
+ typedef nsID nsIID;
+ class nsISupports
+ {
+ };
+ extern "C++"
+ {
+   template < class T > struct nsCOMTypeInfo
+   {
+ static const nsIID & GetIID ()
+ {
+ }
+   };
+ }
+ 
+ class nsIDOMEvent:public nsISupports
+ {
+ };
+ class nsIDOMEventListener:public nsISupports
+ {
+ public:static const nsIID & GetIID ()
+   {
+   }
+   virtual nsresult
+ __attribute__ ((regparm (0), cdecl)) HandleEvent (nsIDOMEvent * event) =
+ 0;
+ };
+ class nsIDOMMouseListener:public nsIDOMEventListener
+ {
+ public:static const nsIID & GetIID ()
+   {
+ static const nsIID iid = {
+ };
+   }
+   virtual nsresult
+ __attribute__ ((regparm (0),
+   cdecl)) MouseDown (nsIDOMEvent * aMouseEvent) = 0;
+ };
+ typedef
+ typeof (&nsIDOMEventListener::HandleEvent)
+   GenericHandler;
+  struct EventDispatchData
+  {
+PRUint32 message;
+GenericHandler method;
+PRUint8 bits;
+  };
+  struct EventTypeData
+  {
+const EventDispatchData *events;
+int numEvents;
+const nsIID *iid;
+  };
+  static const EventDispatchData sMouseEvents[] = {
+{
+   (300 + 2),
+   reinterpret_cast < GenericHandler > (&nsIDOMMouseListener::MouseDown),
+   0x01}
+  };
+ static const EventTypeData sEventTypes[] = {
+   {
+sMouseEvents, (sizeof (sMouseEvents) / sizeof (sMouseEvents[0])),
+&nsCOMTypeInfo < nsIDOMMouseListener >::GetIID ()}
+ };



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm-c/

2007-01-06 Thread Chris Lattner


Changes in directory llvm/include/llvm-c:

---
Log message:

Directory /home/vadve/shared/PublicCVS/llvm/include/llvm-c added to the 
repository


---
Diffs of the changes:  (+0 -0)

 0 files changed



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/test/Regression/Transforms/LoopSimplify/2006-08-11-LoopSimplifyLongTime.ll 2006-08-11-LoopSimplifyLongTime.ll.bc

2007-01-06 Thread Reid Spencer
Oh My,

Do you know how many hours I've spent maintaining that .bc file over the
last few months?

:(

Reid.

On Sat, 2007-01-06 at 16:02 -0600, Chris Lattner wrote:
> 
> Changes in directory llvm/test/Regression/Transforms/LoopSimplify:
> 
> 2006-08-11-LoopSimplifyLongTime.ll (r1.1) removed
> 2006-08-11-LoopSimplifyLongTime.ll.bc (r1.5) removed
> ---
> Log message:
> 
> this testcase is too large to be useful, and requires a .bc file to be 
> kept around.  We can do without it.
> 
> 
> ---
> Diffs of the changes:  (+0 -0)
> 
>  0 files changed
> 
> 
> 
> ___
> llvm-commits mailing list
> llvm-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp

2007-01-06 Thread Reid Spencer
On Sat, 2007-01-06 at 14:06 -0800, Chris Lattner wrote:
> On Jan 6, 2007, at 1:39 PM, Chris Lattner wrote:
> 
> >> gcc often inserts it's own names for sections (e.g.
> >> gnu.linkonce.t.FunctionName). Convert them to "normal" LLVM names,
> >> otherwise linker won't be able to merge them.
> >
> > Can you be a bit more explicit about what this fixes?
> 
> Okay, Anton pointed out that it's a workaround for
> http://llvm.org/bugs/show_bug.cgi?id=1085
> 
> When this CFE bug is fixed, we can revert this patch.

I have a fix in test right now.

> 
> -Chris
> ___
> llvm-commits mailing list
> llvm-commits@cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


Re: [llvm-commits] CVS: llvm/test/Regression/Transforms/LoopSimplify/2006-08-11-LoopSimplifyLongTime.ll 2006-08-11-LoopSimplifyLongTime.ll.bc

2007-01-06 Thread Chris Lattner

On Jan 6, 2007, at 5:26 PM, Reid Spencer wrote:

> Oh My,
>
> Do you know how many hours I've spent maintaining that .bc file  
> over the
> last few months?

That's why I removed it, so you (or anyone else) doesn't have to  
anymore...

-Chris
___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolution.cpp

2007-01-06 Thread Chris Lattner


Changes in directory llvm/lib/Analysis:

ScalarEvolution.cpp updated: 1.78 -> 1.79
---
Log message:

cast of int to bool no longer does a compare, rendering this fixme
obsolete


---
Diffs of the changes:  (+0 -1)

 ScalarEvolution.cpp |1 -
 1 files changed, 1 deletion(-)


Index: llvm/lib/Analysis/ScalarEvolution.cpp
diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.78 
llvm/lib/Analysis/ScalarEvolution.cpp:1.79
--- llvm/lib/Analysis/ScalarEvolution.cpp:1.78  Sat Dec 30 23:48:39 2006
+++ llvm/lib/Analysis/ScalarEvolution.cpp   Sat Jan  6 20:05:20 2007
@@ -1495,7 +1495,6 @@
   // exit.
   //
   // FIXME: we should be able to handle switch instructions (with a single 
exit)
-  // FIXME: We should handle cast of int to bool as well
   BranchInst *ExitBr = dyn_cast(ExitingBlock->getTerminator());
   if (ExitBr == 0) return UnknownValue;
   assert(ExitBr->isConditional() && "If unconditional, it can't be in loop!");



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/Regression/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll

2007-01-06 Thread Chris Lattner


Changes in directory llvm/test/Regression/Transforms/IndVarsSimplify:

2007-01-06-TripCount.ll added (r1.1)
---
Log message:

Testcase for PR1015: http://llvm.org/PR1015 


---
Diffs of the changes:  (+53 -0)

 2007-01-06-TripCount.ll |   53 
 1 files changed, 53 insertions(+)


Index: llvm/test/Regression/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll
diff -c /dev/null 
llvm/test/Regression/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll:1.1
*** /dev/null   Sat Jan  6 20:24:20 2007
--- llvm/test/Regression/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll 
Sat Jan  6 20:24:10 2007
***
*** 0 
--- 1,53 
+ ; RUN: llvm-as < %s | opt -indvars -disable-output &&
+ ; RUN: llvm-as < %s | opt -indvars | llvm-dis | not grep 'ret i32 0'
+ ; PR1015
+ 
+ target datalayout = "e-p:32:32"
+ target endian = little
+ target pointersize = 32
+ target triple = "i686-apple-darwin8"
+ %foo = internal constant [5 x i8] c"\00abc\00"; <[5 x i8]*> 
[#uses=1]
+ %str = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1]
+ 
+ implementation   ; Functions:
+ 
+ define i32 %test(i32 %J) {
+ entry:
+   br label %bb2
+ 
+ bb:   ; preds = %cond_next, %cond_true
+   %tmp1 = add i32 %i.0, 1 ;  [#uses=1]
+   br label %bb2
+ 
+ bb2:  ; preds = %bb, %entry
+   %i.0 = phi i32 [ 0, %entry ], [ %tmp1, %bb ];  
[#uses=4]
+   %tmp = icmp eq i32 %i.0, 0  ;  [#uses=1]
+   br bool %tmp, label %cond_true, label %cond_next
+ 
+ cond_true:; preds = %bb2
+   br label %bb
+ 
+ cond_next:; preds = %bb2
+   %tmp = getelementptr [5 x i8]* %foo, i32 0, i32 %i.0;  
[#uses=1]
+   %tmp = load i8* %tmp;  [#uses=1]
+   %tmp5 = icmp eq i8 %tmp, 0  ;  [#uses=1]
+   br bool %tmp5, label %bb6, label %bb
+ 
+ bb6:  ; preds = %cond_next
+   br label %return
+ 
+ return:   ; preds = %bb6
+   ret i32 %i.0
+ }
+ 
+ define void %main() {
+ entry:
+   %tmp = call i32 %test( i32 0 )  ;  [#uses=1]
+   %tmp1 = call i32 (i8*, ...)* %printf( i8* getelementptr ([4 x i8]* 
%str, i32 0, i32 0), i32 %tmp )  ;  [#uses=0]
+   br label %return
+ 
+ return:   ; preds = %entry
+   ret void
+ }
+ 
+ declare i32 %printf(i8*, ...)



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolution.cpp

2007-01-06 Thread Chris Lattner


Changes in directory llvm/lib/Analysis:

ScalarEvolution.cpp updated: 1.79 -> 1.80
---
Log message:

Fix PR1015: http://llvm.org/PR1015  and 
Transforms/IndVarsSimplify/2007-01-06-TripCount.ll, a
miscompilation of Qt.


---
Diffs of the changes:  (+15 -1)

 ScalarEvolution.cpp |   16 +++-
 1 files changed, 15 insertions(+), 1 deletion(-)


Index: llvm/lib/Analysis/ScalarEvolution.cpp
diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.79 
llvm/lib/Analysis/ScalarEvolution.cpp:1.80
--- llvm/lib/Analysis/ScalarEvolution.cpp:1.79  Sat Jan  6 20:05:20 2007
+++ llvm/lib/Analysis/ScalarEvolution.cpp   Sat Jan  6 20:24:26 2007
@@ -1498,12 +1498,26 @@
   BranchInst *ExitBr = dyn_cast(ExitingBlock->getTerminator());
   if (ExitBr == 0) return UnknownValue;
   assert(ExitBr->isConditional() && "If unconditional, it can't be in loop!");
+  
+  // At this point, we know we have a conditional branch that determines 
whether
+  // the loop is exited.  However, we don't know if the branch is executed each
+  // time through the loop.  If not, then the execution count of the branch 
will
+  // not be equal to the trip count of the loop.
+  //
+  // Currently we check for this by checking to see if the Exit branch goes to
+  // the loop header.  If so, we know it will always execute the same number of
+  // times as the loop.  More extensive analysis could be done to handle more
+  // cases here.
+  if (ExitBr->getSuccessor(0) != L->getHeader() &&
+  ExitBr->getSuccessor(1) != L->getHeader())
+return UnknownValue;
+  
   ICmpInst *ExitCond = dyn_cast(ExitBr->getCondition());
 
   // If its not an integer comparison then compute it the hard way. 
   // Note that ICmpInst deals with pointer comparisons too so we must check
   // the type of the operand.
-  if (ExitCond == 0 || !ExitCond->getOperand(0)->getType()->isIntegral()) 
+  if (ExitCond == 0 || isa(ExitCond->getOperand(0)->getType()))
 return ComputeIterationCountExhaustively(L, ExitBr->getCondition(),
   ExitBr->getSuccessor(0) == 
ExitBlock);
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/Regression/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll

2007-01-06 Thread Chris Lattner


Changes in directory llvm/test/Regression/Transforms/IndVarsSimplify:

2007-01-06-TripCount.ll updated: 1.1 -> 1.2
---
Log message:

Simplify the testcase


---
Diffs of the changes:  (+0 -11)

 2007-01-06-TripCount.ll |   11 ---
 1 files changed, 11 deletions(-)


Index: llvm/test/Regression/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll
diff -u 
llvm/test/Regression/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll:1.1 
llvm/test/Regression/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll:1.2
--- llvm/test/Regression/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll:1.1 
Sat Jan  6 20:24:10 2007
+++ llvm/test/Regression/Transforms/IndVarsSimplify/2007-01-06-TripCount.ll 
Sat Jan  6 20:28:52 2007
@@ -40,14 +40,3 @@
ret i32 %i.0
 }
 
-define void %main() {
-entry:
-   %tmp = call i32 %test( i32 0 )  ;  [#uses=1]
-   %tmp1 = call i32 (i8*, ...)* %printf( i8* getelementptr ([4 x i8]* 
%str, i32 0, i32 0), i32 %tmp )  ;  [#uses=0]
-   br label %return
-
-return:; preds = %entry
-   ret void
-}
-
-declare i32 %printf(i8*, ...)



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] llvm-gcc patch: Map Stomp

2007-01-06 Thread Bill Wendling
Hi all,

I committed this patch. It's one that was committed Apple's GCC. It  
solves a problem where an address gotten from a map could be stomped  
on by a subsequent call-back function.

-bw

In the libcpp directory:

2007-01-06  Bill Wendling  <[EMAIL PROTECTED]>

 Radar 4897123
 * directives.c (_cpp_do_file_change): Array of maps could  
change after
 the "file_change" callback. We should relookup the map  
afterwards.

Index: directives.c
===
--- directives.c(revision 240)
+++ directives.c(working copy)
@@ -943,8 +943,24 @@
if (map != NULL)
  linemap_line_start (pfile->line_table, map->to_line, 127);
+  /* APPLE LOCAL begin 4897123 */
if (pfile->cb.file_change)
-pfile->cb.file_change (pfile, map);
+{
+  struct line_map *old_maps = pfile->line_table->maps;
+  source_location old_loc = 0;
+
+  if (map)
+old_loc = map->start_location;
+
+  pfile->cb.file_change (pfile, map);
+
+  /* The file_change callback could reallocate the line_table  
maps causing
+ "map" we got to be invalid */
+  if (map && old_maps != pfile->line_table->maps)
+map = linemap_lookup (pfile->line_table, old_loc);
+}
+  /* APPLE LOCAL end 4897123 */
+
/* APPLE LOCAL begin 4137741 */
/* If file change debug hook callbacks are being deferred, we will

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp

2007-01-06 Thread Reid Spencer


Changes in directory llvm/lib/Target/CBackend:

Writer.cpp updated: 1.303 -> 1.304
---
Log message:

For PR1086: http://llvm.org/PR1086 :
Parameter attributes do have to be specially handled in the CBE. Implement
their handling.


---
Diffs of the changes:  (+54 -30)

 Writer.cpp |   84 +++--
 1 files changed, 54 insertions(+), 30 deletions(-)


Index: llvm/lib/Target/CBackend/Writer.cpp
diff -u llvm/lib/Target/CBackend/Writer.cpp:1.303 
llvm/lib/Target/CBackend/Writer.cpp:1.304
--- llvm/lib/Target/CBackend/Writer.cpp:1.303   Sat Jan  6 01:24:43 2007
+++ llvm/lib/Target/CBackend/Writer.cpp Sat Jan  6 21:24:48 2007
@@ -114,7 +114,8 @@
   return false;
 }
 
-std::ostream &printType(std::ostream &Out, const Type *Ty,
+std::ostream &printType(std::ostream &Out, const Type *Ty, 
+bool isSigned = true,
 const std::string &VariableName = "",
 bool IgnoreName = false);
 std::ostream &printPrimitiveType(std::ostream &Out, const Type *Ty, 
@@ -342,10 +343,12 @@
 
   FunctionType::param_iterator I = FTy->param_begin(), E = FTy->param_end();
   const Type *RetTy = cast(I->get())->getElementType();
+  unsigned Idx = 1;
   for (++I; I != E; ++I) {
 if (PrintedType)
   FunctionInnards << ", ";
-printType(FunctionInnards, *I, "");
+printType(FunctionInnards, *I, 
+/*isSigned=*/FTy->paramHasAttr(Idx, FunctionType::SExtAttribute), "");
 PrintedType = true;
   }
   if (FTy->isVarArg()) {
@@ -356,7 +359,8 @@
   }
   FunctionInnards << ')';
   std::string tstr = FunctionInnards.str();
-  printType(Out, RetTy, tstr);
+  printType(Out, RetTy, 
+  /*isSigned=*/FTy->paramHasAttr(0, FunctionType::SExtAttribute), tstr);
 }
 
 std::ostream &
@@ -386,13 +390,13 @@
 // declaration.
 //
 std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
- const std::string &NameSoFar,
+ bool isSigned, const std::string &NameSoFar,
  bool IgnoreName) {
   if (Ty->isPrimitiveType()) {
 // FIXME:Signedness. When integer types are signless, this should just
 // always pass "false" for the sign of the primitive type. The instructions
 // will figure out how the value is to be interpreted.
-printPrimitiveType(Out, Ty, true, NameSoFar);
+printPrimitiveType(Out, Ty, isSigned, NameSoFar);
 return Out;
   }
 
@@ -407,11 +411,14 @@
 const FunctionType *FTy = cast(Ty);
 std::stringstream FunctionInnards;
 FunctionInnards << " (" << NameSoFar << ") (";
+unsigned Idx = 1;
 for (FunctionType::param_iterator I = FTy->param_begin(),
E = FTy->param_end(); I != E; ++I) {
   if (I != FTy->param_begin())
 FunctionInnards << ", ";
-  printType(FunctionInnards, *I, "");
+  printType(FunctionInnards, *I, 
+  /*isSigned=*/FTy->paramHasAttr(Idx, FunctionType::SExtAttribute), 
"");
+  ++Idx;
 }
 if (FTy->isVarArg()) {
   if (FTy->getNumParams())
@@ -421,7 +428,8 @@
 }
 FunctionInnards << ')';
 std::string tstr = FunctionInnards.str();
-printType(Out, FTy->getReturnType(), tstr);
+printType(Out, FTy->getReturnType(), 
+/*isSigned=*/FTy->paramHasAttr(0, FunctionType::SExtAttribute), tstr);
 return Out;
   }
   case Type::StructTyID: {
@@ -431,7 +439,7 @@
 for (StructType::element_iterator I = STy->element_begin(),
E = STy->element_end(); I != E; ++I) {
   Out << "  ";
-  printType(Out, *I, "field" + utostr(Idx++));
+  printType(Out, *I, true, "field" + utostr(Idx++));
   Out << ";\n";
 }
 return Out << '}';
@@ -445,14 +453,14 @@
 isa(PTy->getElementType()))
   ptrName = "(" + ptrName + ")";
 
-return printType(Out, PTy->getElementType(), ptrName);
+return printType(Out, PTy->getElementType(), true, ptrName);
   }
 
   case Type::ArrayTyID: {
 const ArrayType *ATy = cast(Ty);
 unsigned NumElements = ATy->getNumElements();
 if (NumElements == 0) NumElements = 1;
-return printType(Out, ATy->getElementType(),
+return printType(Out, ATy->getElementType(), true,
  NameSoFar + "[" + utostr(NumElements) + "]");
   }
 
@@ -460,7 +468,7 @@
 const PackedType *PTy = cast(Ty);
 unsigned NumElements = PTy->getNumElements();
 if (NumElements == 0) NumElements = 1;
-return printType(Out, PTy->getElementType(),
+return printType(Out, PTy->getElementType(), true,
  NameSoFar + "[" + utostr(NumElements) + "]");
   }
 
@@ -1431,15 +1439,18 @@
  I != E; ++I) {
   if (I->hasExternalLinkage()) {
 Out << "extern ";
-printType(Out, I->getType()->getElementType(), Mang->getValueName(I));
+printType(Out, I->getType()->getElementType(), true, 
+  Mang->getValueName(I));
 Out << ";\