From lattner at cs.uiuc.edu Mon Mar 28 00:21:33 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 28 Mar 2005 00:21:33 -0600
Subject: [llvm-commits] CVS: llvm/lib/Analysis/IPA/Andersens.cpp
Message-ID: <200503280621.j2S6LX9i001415@apoc.cs.uiuc.edu>
Changes in directory llvm/lib/Analysis/IPA:
Andersens.cpp updated: 1.15 -> 1.16
---
Log message:
Teach andersens that non-escaping memory cannot be mod/ref'd by external fn calls.
---
Diffs of the changes: (+40 -2)
Andersens.cpp | 42 ++++++++++++++++++++++++++++++++++++++++--
1 files changed, 40 insertions(+), 2 deletions(-)
Index: llvm/lib/Analysis/IPA/Andersens.cpp
diff -u llvm/lib/Analysis/IPA/Andersens.cpp:1.15 llvm/lib/Analysis/IPA/Andersens.cpp:1.16
--- llvm/lib/Analysis/IPA/Andersens.cpp:1.15 Sun Mar 27 22:32:12 2005
+++ llvm/lib/Analysis/IPA/Andersens.cpp Mon Mar 28 00:21:17 2005
@@ -235,6 +235,7 @@
//
AliasResult alias(const Value *V1, unsigned V1Size,
const Value *V2, unsigned V2Size);
+ ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size);
void getMustAliases(Value *P, std::vector &RetVals);
bool pointsToConstantMemory(const Value *P);
@@ -346,8 +347,8 @@
AliasAnalysis::AliasResult Andersens::alias(const Value *V1, unsigned V1Size,
const Value *V2, unsigned V2Size) {
- Node *N1 = getNode((Value*)V1);
- Node *N2 = getNode((Value*)V2);
+ Node *N1 = getNode(const_cast(V1));
+ Node *N2 = getNode(const_cast(V2));
// Check to see if the two pointers are known to not alias. They don't alias
// if their points-to sets do not intersect.
@@ -357,6 +358,39 @@
return AliasAnalysis::alias(V1, V1Size, V2, V2Size);
}
+AliasAnalysis::ModRefResult
+Andersens::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
+ // The only thing useful that we can contribute for mod/ref information is
+ // when calling external function calls: if we know that memory never escapes
+ // from the program, it cannot be modified by an external call.
+ //
+ // NOTE: This is not really safe, at least not when the entire program is not
+ // available. The deal is that the external function could call back into the
+ // program and modify stuff. We ignore this technical niggle for now. This
+ // is, after all, a "research quality" implementation of Andersen's analysis.
+ if (Function *F = CS.getCalledFunction())
+ if (F->isExternal()) {
+ Node *N1 = getNode(P);
+ bool PointsToUniversalSet = false;
+
+ for (Node::iterator NI = N1->begin(), E = N1->end(); NI != E; ++NI) {
+ Node *PN = *NI;
+ if (PN->begin() == PN->end())
+ continue; // P doesn't point to anything.
+ // Get the first pointee.
+ Node *FirstPointee = *PN->begin();
+ if (FirstPointee == &GraphNodes[UniversalSet]) {
+ PointsToUniversalSet = true;
+ break;
+ }
+ }
+
+ if (!PointsToUniversalSet)
+ return NoModRef; // P doesn't point to the universal set.
+ }
+
+ return AliasAnalysis::getModRefInfo(CS, P, Size);
+}
/// getMustAlias - We can provide must alias information if we know that a
/// pointer can only point to a specific function or the null pointer.
@@ -604,6 +638,10 @@
void Andersens::CollectConstraints(Module &M) {
// First, the universal set points to itself.
GraphNodes[UniversalSet].addPointerTo(&GraphNodes[UniversalSet]);
+ Constraints.push_back(Constraint(Constraint::Load, &GraphNodes[UniversalSet],
+ &GraphNodes[UniversalSet]));
+ Constraints.push_back(Constraint(Constraint::Store, &GraphNodes[UniversalSet],
+ &GraphNodes[UniversalSet]));
// Next, the null pointer points to the null object.
GraphNodes[NullPtr].addPointerTo(&GraphNodes[NullObject]);
From alkis at cs.uiuc.edu Mon Mar 28 09:30:09 2005
From: alkis at cs.uiuc.edu (Alkis Evlogimenos)
Date: Mon, 28 Mar 2005 09:30:09 -0600
Subject: [llvm-commits] CVS: llvm-java/tools/class2llvm/Makefile
Message-ID: <200503281530.JAA32472@zion.cs.uiuc.edu>
Changes in directory llvm-java/tools/class2llvm:
Makefile updated: 1.7 -> 1.8
---
Log message:
Disable llc diffs.
---
Diffs of the changes: (+2 -1)
Makefile | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)
Index: llvm-java/tools/class2llvm/Makefile
diff -u llvm-java/tools/class2llvm/Makefile:1.7 llvm-java/tools/class2llvm/Makefile:1.8
--- llvm-java/tools/class2llvm/Makefile:1.7 Thu Dec 2 15:51:12 2004
+++ llvm-java/tools/class2llvm/Makefile Mon Mar 28 09:29:55 2005
@@ -11,6 +11,7 @@
TOOLNAME := class2llvm
USEDLIBS := LLVMJavaClassfile LLVMJavaCompiler
-LLVMLIBS := LLVMBCWriter LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a
+LLVMLIBS := LLVMScalarOpts.a LLVMTarget.a LLVMTransformUtils.a LLVMAnalysis.a \
+ LLVMBCWriter LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a
include $(LEVEL)/Makefile.common
From duraid at octopus.com.au Mon Mar 28 09:21:54 2005
From: duraid at octopus.com.au (Duraid Madina)
Date: Mon, 28 Mar 2005 09:21:54 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/IA64/IA64AsmPrinter.cpp
Message-ID: <200503281521.JAA32388@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/IA64:
IA64AsmPrinter.cpp updated: 1.3 -> 1.4
---
Log message:
Emit .global @function and .global @object entries so the Intel ias
assembler may be used; identify LLVM output as such.
---
Diffs of the changes: (+21 -7)
IA64AsmPrinter.cpp | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
Index: llvm/lib/Target/IA64/IA64AsmPrinter.cpp
diff -u llvm/lib/Target/IA64/IA64AsmPrinter.cpp:1.3 llvm/lib/Target/IA64/IA64AsmPrinter.cpp:1.4
--- llvm/lib/Target/IA64/IA64AsmPrinter.cpp:1.3 Wed Mar 23 23:12:48 2005
+++ llvm/lib/Target/IA64/IA64AsmPrinter.cpp Mon Mar 28 09:21:43 2005
@@ -36,7 +36,7 @@
struct IA64SharedAsmPrinter : public AsmPrinter {
- std::set ExternalFunctionNames;
+ std::set ExternalFunctionNames, ExternalObjectNames;
IA64SharedAsmPrinter(std::ostream &O, TargetMachine &TM)
: AsmPrinter(O, TM) { }
@@ -84,7 +84,8 @@
if (CP.empty()) return;
- O << "\n\t.section .data\n"; // would be nice to have this rodata? hmmm
+ O << "\n\t.section .data, \"aw\", \"progbits\"\n";
+ // FIXME: would be nice to have rodata (no 'w') when appropriate?
for (unsigned i = 0, e = CP.size(); i != e; ++i) {
emitAlignment(TD.getTypeAlignmentShift(CP[i]->getType()));
O << ".CPI" << CurrentFnName << "_" << i << ":\t\t\t\t\t" << CommentString
@@ -112,7 +113,7 @@
I->hasWeakLinkage() /* FIXME: Verify correct */)) {
SwitchSection(O, CurSection, ".data");
if (I->hasInternalLinkage())
- O << "\t.local " << name << "\n";
+// FIXME O << "\t.local " << name << "\n";
O << "\t.common " << name << "," << TD.getTypeSize(C->getType())
<< "," << (1 << Align);
@@ -169,6 +170,14 @@
}
O << "\n\n";
+ // we print out ".global X \n .type X, @object" for each external object
+ O << "\n\n// (external) symbols referenced (and not defined) above: \n";
+ for (std::set::iterator i = ExternalObjectNames.begin(),
+ e = ExternalObjectNames.end(); i!=e; ++i) {
+ O << "\t.global " << *i << "\n\t.type " << *i << ", @object\n";
+ }
+ O << "\n\n";
+
AsmPrinter::doFinalization(M);
return false; // success
}
@@ -265,7 +274,7 @@
// Print out labels for the function.
O << "\n\t.section .text, \"ax\", \"progbits\"\n";
// ^^ means "Allocated instruXions in mem, initialized"
- emitAlignment(4);
+ emitAlignment(5);
O << "\t.global\t" << CurrentFnName << "\n";
O << "\t.type\t" << CurrentFnName << ", @function\n";
O << CurrentFnName << ":\n";
@@ -343,9 +352,12 @@
// the function somewhere (GNU gas has no problem without this, but
// Intel ias rightly complains of an 'undefined symbol')
- if(F && isBRCALLinsn && F->isExternal())
+ if(F /*&& isBRCALLinsn*/ && F->isExternal())
ExternalFunctionNames.insert(Mang->getValueName(MO.getGlobal()));
-
+ else
+ if(GV->isExternal()) // e.g. stuff like 'stdin'
+ ExternalObjectNames.insert(Mang->getValueName(MO.getGlobal()));
+
if (!isBRCALLinsn)
O << "@ltoff(";
if (Needfptr)
@@ -364,6 +376,7 @@
}
case MachineOperand::MO_ExternalSymbol:
O << MO.getSymbolName();
+ ExternalFunctionNames.insert(MO.getSymbolName());
return;
default:
O << ""; return;
@@ -384,7 +397,8 @@
bool IA64AsmPrinter::doInitialization(Module &M) {
AsmPrinter::doInitialization(M);
- O << "\t.psr lsb\n" // should be "msb" on HP-UX, for starters
+ O << "\n.ident \"LLVM-ia64\"\n\n"
+ << "\t.psr lsb\n" // should be "msb" on HP-UX, for starters
<< "\t.radix C\n"
<< "\t.psr abi64\n"; // we only support 64 bits for now
return false;
From alkis at cs.uiuc.edu Mon Mar 28 09:33:55 2005
From: alkis at cs.uiuc.edu (Alkis Evlogimenos)
Date: Mon, 28 Mar 2005 09:33:55 -0600
Subject: [llvm-commits] CVS: llvm-java/test/Makefile.test
Message-ID: <200503281533.JAA32505@zion.cs.uiuc.edu>
Changes in directory llvm-java/test:
Makefile.test updated: 1.45 -> 1.46
---
Log message:
Disable llc diffs.
---
Diffs of the changes: (+1 -1)
Makefile.test | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
Index: llvm-java/test/Makefile.test
diff -u llvm-java/test/Makefile.test:1.45 llvm-java/test/Makefile.test:1.46
--- llvm-java/test/Makefile.test:1.45 Sat Mar 12 02:29:57 2005
+++ llvm-java/test/Makefile.test Mon Mar 28 09:33:44 2005
@@ -115,6 +115,6 @@
%.bugpoint.gccld: %.raw.llvm.bc %.out-nat
$(LBUGPOINT) $< $(GCCLD_PASS_ARGS) -output=$*.out-nat
-all-local:: $(JIT_DIFFS) $(LLC_DIFFS)
+all-local:: $(JIT_DIFFS)
endif
From alkis at cs.uiuc.edu Mon Mar 28 09:36:05 2005
From: alkis at cs.uiuc.edu (Alkis Evlogimenos)
Date: Mon, 28 Mar 2005 09:36:05 -0600
Subject: [llvm-commits] CVS: llvm-java/tools/class2llvm/Makefile
Message-ID: <200503281536.JAA32529@zion.cs.uiuc.edu>
Changes in directory llvm-java/tools/class2llvm:
Makefile updated: 1.8 -> 1.9
---
Log message:
Revert patch committed by mistake.
---
Diffs of the changes: (+1 -2)
Makefile | 3 +--
1 files changed, 1 insertion(+), 2 deletions(-)
Index: llvm-java/tools/class2llvm/Makefile
diff -u llvm-java/tools/class2llvm/Makefile:1.8 llvm-java/tools/class2llvm/Makefile:1.9
--- llvm-java/tools/class2llvm/Makefile:1.8 Mon Mar 28 09:29:55 2005
+++ llvm-java/tools/class2llvm/Makefile Mon Mar 28 09:35:54 2005
@@ -11,7 +11,6 @@
TOOLNAME := class2llvm
USEDLIBS := LLVMJavaClassfile LLVMJavaCompiler
-LLVMLIBS := LLVMScalarOpts.a LLVMTarget.a LLVMTransformUtils.a LLVMAnalysis.a \
- LLVMBCWriter LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a
+LLVMLIBS := LLVMBCWriter LLVMCore LLVMSupport.a LLVMbzip2 LLVMSystem.a
include $(LEVEL)/Makefile.common
From lattner at cs.uiuc.edu Mon Mar 28 12:40:37 2005
From: lattner at cs.uiuc.edu (Chris Lattner)
Date: Mon, 28 Mar 2005 12:40:37 -0600
Subject: [llvm-commits] CVS: llvm-www/testresults/index.html
Message-ID: <200503281840.j2SIebLW012383@apoc.cs.uiuc.edu>
Changes in directory llvm-www/testresults:
index.html updated: 1.33 -> 1.34
---
Log message:
Add Al Stone's IA64 tester, sort by architecture
---
Diffs of the changes: (+32 -25)
index.html | 57 ++++++++++++++++++++++++++++++++-------------------------
1 files changed, 32 insertions(+), 25 deletions(-)
Index: llvm-www/testresults/index.html
diff -u llvm-www/testresults/index.html:1.33 llvm-www/testresults/index.html:1.34
--- llvm-www/testresults/index.html:1.33 Thu Mar 24 22:52:01 2005
+++ llvm-www/testresults/index.html Mon Mar 28 12:40:20 2005
@@ -18,8 +18,39 @@
mailing list.
-X86
+Alpha
+
+
+- Linux (Single 21164 EV56 500
+MHz) -- release build
+
+- Linux (Single 21264 EV7
+633 MHz) -- debug build
+
+
+IA-64
+
+
+- Debian GNU/Linux
+unstable, dual Itanium2(tm) 1.5GHz -- debug build
+
+
+
+PowerPC
+
+
+- Mac OS X 10.3
+"Panther" on PowerPC G5 (dual 1.8Ghz CPU) -- debug build
+
+Sparc V9
+
+
+- SunOS 5.8 on Sun Fire V240 (dual 1Ghz CPU) -- debug
+build
+
+
+X86
- Linux (Dual P4 Xeon @ 3.06GHz) -- debug build
@@ -42,30 +73,6 @@
-PowerPC
-
-
-- Mac OS X 10.3
-"Panther" on PowerPC G5 (dual 1.8Ghz CPU) -- debug build
-
-
-Sparc V9
-
-
-- SunOS 5.8 on Sun Fire V240 (dual 1Ghz CPU) -- debug
-build
-
-
-Alpha
-
-
-- Linux (Single 21164 EV56 500 MHz) -- release
-build
-
-- Linux (Single 21264 EV7 633 MHz) -- debug
-build
-
-
From alenhar2 at cs.uiuc.edu Mon Mar 28 13:03:45 2005
From: alenhar2 at cs.uiuc.edu (Andrew Lenharth)
Date: Mon, 28 Mar 2005 13:03:45 -0600
Subject: [llvm-commits]
CVS: llvm-test/MultiSource/Benchmarks/Olden/voronoi/newvor.c
Message-ID: <200503281903.NAA08995@niobe.cs.uiuc.edu>
Changes in directory llvm-test/MultiSource/Benchmarks/Olden/voronoi:
newvor.c updated: 1.8 -> 1.9
---
Log message:
added define for alpha to get correct prototype for memalign
---
Diffs of the changes: (+5 -0)
newvor.c | 5 +++++
1 files changed, 5 insertions(+)
Index: llvm-test/MultiSource/Benchmarks/Olden/voronoi/newvor.c
diff -u llvm-test/MultiSource/Benchmarks/Olden/voronoi/newvor.c:1.8 llvm-test/MultiSource/Benchmarks/Olden/voronoi/newvor.c:1.9
--- llvm-test/MultiSource/Benchmarks/Olden/voronoi/newvor.c:1.8 Mon Mar 7 10:41:13 2005
+++ llvm-test/MultiSource/Benchmarks/Olden/voronoi/newvor.c Mon Mar 28 13:03:28 2005
@@ -4,6 +4,11 @@
#include
#include "defines.h"
+#if defined(__alpha__)
+#include
+#endif
+
+
VERTEX_PTR *vp ;
struct VERTEX *va ;
EDGE_PTR *next ;
From alkis at cs.uiuc.edu Mon Mar 28 13:19:38 2005
From: alkis at cs.uiuc.edu (Alkis Evlogimenos)
Date: Mon, 28 Mar 2005 13:19:38 -0600
Subject: [llvm-commits] CVS: llvm-java/runtime/runtime.c
Message-ID: <200503281919.NAA01335@zion.cs.uiuc.edu>
Changes in directory llvm-java/runtime:
runtime.c updated: 1.22 -> 1.23
---
Log message:
Always use memmove when copying arrays.
---
Diffs of the changes: (+1 -6)
runtime.c | 7 +------
1 files changed, 1 insertion(+), 6 deletions(-)
Index: llvm-java/runtime/runtime.c
diff -u llvm-java/runtime/runtime.c:1.22 llvm-java/runtime/runtime.c:1.23
--- llvm-java/runtime/runtime.c:1.22 Fri Mar 25 20:40:48 2005
+++ llvm-java/runtime/runtime.c Mon Mar 28 13:19:27 2005
@@ -380,12 +380,7 @@
src += srcStart * srcObj->vtable->typeinfo.elementSize;
dst += dstStart * dstObj->vtable->typeinfo.elementSize;
- // If arrays do not overlap use memcpy.
- if ((dst > src ? dst - src : src - dst) > nbytes)
- memcpy(dst, src, nbytes);
- // If arrays overlap use memmove.
- else
- memmove(dst, src, nbytes);
+ memmove(dst, src, nbytes);
}
void Java_gnu_classpath_VMSystemProperties_preInit(JNIEnv *env, jobject clazz,
From natebegeman at mac.com Mon Mar 28 13:36:54 2005
From: natebegeman at mac.com (Nate Begeman)
Date: Mon, 28 Mar 2005 13:36:54 -0600
Subject: [llvm-commits] CVS: llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
Message-ID: <200503281936.NAA01615@zion.cs.uiuc.edu>
Changes in directory llvm/lib/Target/PowerPC:
PPC32ISelPattern.cpp updated: 1.9 -> 1.10
---
Log message:
Implement proper loads and zero-extends of all types
---
Diffs of the changes: (+61 -12)
PPC32ISelPattern.cpp | 73 ++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 61 insertions(+), 12 deletions(-)
Index: llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
diff -u llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp:1.9 llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp:1.10
--- llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp:1.9 Sat Mar 26 02:25:22 2005
+++ llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp Mon Mar 28 13:36:43 2005
@@ -559,8 +559,37 @@
return Result;
case ISD::LOAD:
- case ISD::EXTLOAD:
- abort();
+ case ISD::EXTLOAD: {
+ MVT::ValueType TypeBeingLoaded = (ISD::LOAD == opcode) ?
+ Node->getValueType(0) : cast(Node)->getExtraValueType();
+
+ // Make sure we generate both values.
+ if (Result != 1)
+ ExprMap[N.getValue(1)] = 1; // Generate the token
+ else
+ Result = ExprMap[N.getValue(0)] = MakeReg(N.getValue(0).getValueType());
+
+ SDOperand Chain = N.getOperand(0);
+ SDOperand Address = N.getOperand(1);
+ Select(Chain);
+
+ switch (TypeBeingLoaded) {
+ default: assert(0 && "Cannot fp load this type!");
+ case MVT::f32: Opc = PPC::LFS; break;
+ case MVT::f64: Opc = PPC::LFD; break;
+ }
+
+ if(Address.getOpcode() == ISD::FrameIndex) {
+ BuildMI(BB, Opc, 2, Result)
+ .addFrameIndex(cast(Address)->getIndex())
+ .addReg(PPC::R1);
+ } else {
+ int offset;
+ SelectAddr(Address, Tmp1, offset);
+ BuildMI(BB, Opc, 2, Result).addSImm(offset).addReg(Tmp1);
+ }
+ return Result;
+ }
case ISD::ConstantFP:
abort();
@@ -681,6 +710,11 @@
case ISD::EXTLOAD:
case ISD::ZEXTLOAD:
case ISD::SEXTLOAD: {
+ bool sext = (ISD::SEXTLOAD == opcode);
+ bool byte = (MVT::i8 == Node->getValueType(0));
+ MVT::ValueType TypeBeingLoaded = (ISD::LOAD == opcode) ?
+ Node->getValueType(0) : cast(Node)->getExtraValueType();
+
// Make sure we generate both values.
if (Result != 1)
ExprMap[N.getValue(1)] = 1; // Generate the token
@@ -691,14 +725,20 @@
SDOperand Address = N.getOperand(1);
Select(Chain);
- switch (Node->getValueType(0)) {
+ switch (TypeBeingLoaded) {
default: assert(0 && "Cannot load this type!");
- case MVT::i1: Opc = PPC::LBZ; Tmp3 = 0; break;
- case MVT::i8: Opc = PPC::LBZ; Tmp3 = 1; break;
- case MVT::i16: Opc = PPC::LHZ; Tmp3 = 0; break;
- case MVT::i32: Opc = PPC::LWZ; Tmp3 = 0; break;
+ case MVT::i1: Opc = PPC::LBZ; break;
+ case MVT::i8: Opc = PPC::LBZ; break;
+ case MVT::i16: Opc = sext ? PPC::LHA : PPC::LHZ; break;
+ case MVT::i32: Opc = PPC::LWZ; break;
}
+ // Since there's no load byte & sign extend instruction we have to split
+ // byte SEXTLOADs into lbz + extsb. This requires we make a temp register.
+ if (sext && byte) {
+ Tmp3 = Result;
+ Result = MakeReg(MVT::i32);
+ }
if(Address.getOpcode() == ISD::FrameIndex) {
BuildMI(BB, Opc, 2, Result)
.addFrameIndex(cast(Address)->getIndex())
@@ -708,6 +748,10 @@
SelectAddr(Address, Tmp1, offset);
BuildMI(BB, Opc, 2, Result).addSImm(offset).addReg(Tmp1);
}
+ if (sext && byte) {
+ BuildMI(BB, PPC::EXTSB, 1, Tmp3).addReg(Result);
+ Result = Tmp3;
+ }
return Result;
}
@@ -809,16 +853,21 @@
case ISD::SIGN_EXTEND:
case ISD::SIGN_EXTEND_INREG:
Tmp1 = SelectExpr(N.getOperand(0));
- BuildMI(BB, PPC::EXTSH, 1, Result).addReg(Tmp1);
+ switch(cast(Node)->getExtraValueType()) {
+ default: Node->dump(); assert(0 && "Unhandled SIGN_EXTEND type"); break;
+ case MVT::i16:
+ BuildMI(BB, PPC::EXTSH, 1, Result).addReg(Tmp1);
+ break;
+ case MVT::i8:
+ BuildMI(BB, PPC::EXTSB, 1, Result).addReg(Tmp1);
+ break;
+ }
return Result;
case ISD::ZERO_EXTEND_INREG:
Tmp1 = SelectExpr(N.getOperand(0));
switch(cast(Node)->getExtraValueType()) {
- default:
- Node->dump();
- assert(0 && "Zero Extend InReg not there yet");
- break;
+ default: Node->dump(); assert(0 && "Unhandled ZERO_EXTEND type"); break;
case MVT::i16: Tmp2 = 16; break;
case MVT::i8: Tmp2 = 24; break;
case MVT::i1: Tmp2 = 31; break;
From alkis at cs.uiuc.edu Mon Mar 28 13:53:35 2005
From: alkis at cs.uiuc.edu (Alkis Evlogimenos)
Date: Mon, 28 Mar 2005 13:53:35 -0600
Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/VMClass.h VMClass.cpp
Resolver.h Resolver.cpp Compiler.cpp Class.h Class.cpp
Message-ID: <200503281953.NAA01931@zion.cs.uiuc.edu>
Changes in directory llvm-java/lib/Compiler:
VMClass.h updated: 1.12 -> 1.13
VMClass.cpp updated: 1.13 -> 1.14
Resolver.h updated: 1.7 -> 1.8
Resolver.cpp updated: 1.5 -> 1.6
Compiler.cpp updated: 1.260 -> 1.261
Class.h (r1.12) removed
Class.cpp (r1.13) removed
---
Log message:
Rename Class to VMClass.
---
Diffs of the changes: (+101 -97)
Compiler.cpp | 88 ++++++++++++++++++++++++++++++-----------------------------
Resolver.cpp | 26 ++++++++---------
Resolver.h | 18 ++++++------
VMClass.cpp | 38 ++++++++++++-------------
VMClass.h | 28 +++++++++---------
5 files changed, 101 insertions(+), 97 deletions(-)
Index: llvm-java/lib/Compiler/VMClass.h
diff -u llvm-java/lib/Compiler/VMClass.h:1.12 llvm-java/lib/Compiler/VMClass.h:1.13
--- llvm-java/lib/Compiler/VMClass.h:1.12 Sun Mar 27 20:46:19 2005
+++ llvm-java/lib/Compiler/VMClass.h Mon Mar 28 13:53:24 2005
@@ -1,4 +1,4 @@
-//===-- Class.h - Compiler representation of a Java class -------*- C++ -*-===//
+//===-- VMClass.h - Compiler representation of a Java class -----*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -27,13 +27,13 @@
class ClassFile;
class Resolver;
- class Class {
+ class VMClass {
static const unsigned INVALID_INTERFACE_INDEX = 0xFFFFFFFF;
const std::string name_;
Resolver* resolver_;
const ClassFile* classFile_;
- const Class* componentClass_;
+ const VMClass* componentClass_;
Type* structType_;
const Type* type_;
unsigned interfaceIndex_;
@@ -42,8 +42,8 @@
typedef std::vector ElementTypes;
ElementTypes elementTypes_;
mutable std::vector resolvedConstantPool_;
- std::vector superClasses_;
- std::vector interfaces_;
+ std::vector superClasses_;
+ std::vector interfaces_;
void addField(const std::string& name, const Type* type);
void resolveType();
@@ -53,13 +53,13 @@
// Resolver interface.
// Load primitive class for type.
- Class(Resolver* resolver, const Type* type);
+ VMClass(Resolver* resolver, const Type* type);
// Load class by name.
- Class(Resolver* resolver, const std::string& className);
+ VMClass(Resolver* resolver, const std::string& className);
// Load array class of component the passed class.
- Class(Resolver* resolver, const Class* componentClass);
+ VMClass(Resolver* resolver, const VMClass* componentClass);
// Link the class.
void link();
@@ -74,13 +74,13 @@
const Type* getType() const { return type_; }
const ClassFile* getClassFile() const { return classFile_; }
unsigned getNumSuperClasses() const { return superClasses_.size(); }
- const Class* getSuperClass(unsigned i) const { return superClasses_[i]; }
- const Class* getSuperClass() const {
+ const VMClass* getSuperClass(unsigned i) const { return superClasses_[i]; }
+ const VMClass* getSuperClass() const {
return getNumSuperClasses() ? getSuperClass(0) : NULL;
}
unsigned getNumInterfaces() const { return interfaces_.size(); }
- const Class* getInterface(unsigned i) const { return interfaces_[i]; }
- const Class* getComponentClass() const { return componentClass_; }
+ const VMClass* getInterface(unsigned i) const { return interfaces_[i]; }
+ const VMClass* getComponentClass() const { return componentClass_; }
bool isArray() const { return componentClass_; }
bool isPrimitive() const { return !structType_; }
bool isInterface() const { return classFile_ && !getSuperClass(); }
@@ -88,8 +88,8 @@
int getFieldIndex(const std::string& name) const;
llvm::Constant* getConstant(unsigned index) const;
- const Class* getClassForClass(unsigned index) const;
- const Class* getClassForDescriptor(unsigned index) const;
+ const VMClass* getClassForClass(unsigned index) const;
+ const VMClass* getClassForDescriptor(unsigned index) const;
};
} } // namespace llvm::Java
Index: llvm-java/lib/Compiler/VMClass.cpp
diff -u llvm-java/lib/Compiler/VMClass.cpp:1.13 llvm-java/lib/Compiler/VMClass.cpp:1.14
--- llvm-java/lib/Compiler/VMClass.cpp:1.13 Sun Mar 27 20:48:25 2005
+++ llvm-java/lib/Compiler/VMClass.cpp Mon Mar 28 13:53:24 2005
@@ -1,4 +1,4 @@
-//===-- Class.cpp - Compiler representation of a Java class -----*- C++ -*-===//
+//===-- VMClass.cpp - Compiler representation of a Java class ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -15,7 +15,7 @@
//
//===----------------------------------------------------------------------===//
-#include "Class.h"
+#include "VMClass.h"
#include "Resolver.h"
#include
#include
@@ -26,7 +26,7 @@
using namespace llvm;
using namespace llvm::Java;
-Class::Class(Resolver* resolver, const std::string& className)
+VMClass::VMClass(Resolver* resolver, const std::string& className)
: name_(Resolver::canonicalizeClassName(className)),
resolver_(resolver),
classFile_(ClassFile::get(className)),
@@ -39,7 +39,7 @@
}
-Class::Class(Resolver* resolver, const Class* componentClass)
+VMClass::VMClass(Resolver* resolver, const VMClass* componentClass)
: name_('[' + componentClass->getName()),
resolver_(resolver),
classFile_(NULL),
@@ -51,7 +51,7 @@
}
-Class::Class(Resolver* resolver, const Type* type)
+VMClass::VMClass(Resolver* resolver, const Type* type)
: name_(type == Type::SByteTy ? "B" :
type == Type::UShortTy ? "C" :
type == Type::DoubleTy ? "D" :
@@ -70,18 +70,18 @@
}
-void Class::addField(const std::string& name, const Type* type)
+void VMClass::addField(const std::string& name, const Type* type)
{
f2iMap_.insert(std::make_pair(name, elementTypes_.size()));
elementTypes_.push_back(type);
}
-int Class::getFieldIndex(const std::string& name) const {
+int VMClass::getFieldIndex(const std::string& name) const {
Field2IndexMap::const_iterator it = f2iMap_.find(name);
return it == f2iMap_.end() ? -1 : it->second;
}
-void Class::resolveType() {
+void VMClass::resolveType() {
PATypeHolder holder = structType_;
Type* resolvedType = StructType::get(elementTypes_);
cast(structType_)->refineAbstractTypeTo(resolvedType);
@@ -89,7 +89,7 @@
type_ = PointerType::get(structType_);
}
-void Class::link()
+void VMClass::link()
{
assert(!isPrimitive() && "Should not link primitive classes!");
@@ -111,7 +111,7 @@
// This is any class but java/lang/Object.
else {
// Our direct super class.
- const Class* superClass =
+ const VMClass* superClass =
resolver_->getClass(classFile_->getSuperClass()->getName()->str());
// Add the interfaces of our direct superclass.
@@ -121,7 +121,7 @@
// For each of the interfaces we implement, load it and add that
// interface and all the interfaces it inherits from.
for (unsigned i = 0, e = classFile_->getNumInterfaces(); i != e; ++i) {
- const Class* interface =
+ const VMClass* interface =
getClassForClass(classFile_->getInterfaceIndex(i));
interfaces_.push_back(interface);
for (unsigned j = 0, f = interface->getNumInterfaces(); j != f; ++j)
@@ -169,7 +169,7 @@
assert(!isa(getStructType()) &&"Class not initialized properly!");
}
-llvm::Constant* Class::getConstant(unsigned index) const
+llvm::Constant* VMClass::getConstant(unsigned index) const
{
assert(classFile_ && "No constant pool!");
assert((dynamic_cast(classFile_->getConstant(index)) ||
@@ -183,7 +183,7 @@
if (!resolvedConstantPool_[index]) {
Constant* jc = classFile_->getConstant(index);
if (ConstantString* s = dynamic_cast(jc)) {
- const Class* stringClass = resolver_->getClass("java/lang/String");
+ const VMClass* stringClass = resolver_->getClass("java/lang/String");
const Type* stringType = stringClass->getStructType();
resolvedConstantPool_[index] =
new GlobalVariable(stringType,
@@ -212,7 +212,7 @@
return static_cast(resolvedConstantPool_[index]);
}
-const Class* Class::getClassForClass(unsigned index) const
+const VMClass* VMClass::getClassForClass(unsigned index) const
{
assert(classFile_ && "No constant pool!");
assert(dynamic_cast(classFile_->getConstant(index)) &&
@@ -222,13 +222,13 @@
if (!resolvedConstantPool_[index]) {
ConstantClass* jc = classFile_->getConstantClass(index);
resolvedConstantPool_[index] =
- const_cast(resolver_->getClass(jc->getName()->str()));
+ const_cast(resolver_->getClass(jc->getName()->str()));
}
- return static_cast(resolvedConstantPool_[index]);
+ return static_cast(resolvedConstantPool_[index]);
}
-const Class* Class::getClassForDescriptor(unsigned index) const
+const VMClass* VMClass::getClassForDescriptor(unsigned index) const
{
assert(classFile_ && "No constant pool!");
assert(dynamic_cast(classFile_->getConstant(index)) &&
@@ -238,8 +238,8 @@
if (!resolvedConstantPool_[index]) {
ConstantUtf8* jc = classFile_->getConstantUtf8(index);
resolvedConstantPool_[index] =
- const_cast(resolver_->getClassForDesc(jc->str()));
+ const_cast(resolver_->getClassForDesc(jc->str()));
}
- return static_cast(resolvedConstantPool_[index]);
+ return static_cast(resolvedConstantPool_[index]);
}
Index: llvm-java/lib/Compiler/Resolver.h
diff -u llvm-java/lib/Compiler/Resolver.h:1.7 llvm-java/lib/Compiler/Resolver.h:1.8
--- llvm-java/lib/Compiler/Resolver.h:1.7 Sun Mar 27 20:48:25 2005
+++ llvm-java/lib/Compiler/Resolver.h Mon Mar 28 13:53:24 2005
@@ -15,7 +15,7 @@
#ifndef LLVM_JAVA_RESOLVER_H
#define LLVM_JAVA_RESOLVER_H
-#include "Class.h"
+#include "VMClass.h"
#include
#include
#include
@@ -27,26 +27,26 @@
class Resolver {
Module* module_;
- typedef std::map ClassMap;
+ typedef std::map ClassMap;
ClassMap classMap_;
unsigned nextInterfaceIndex_;
const Type* objectBaseType_;
const Type* objectBaseRefType_;
- const Class* getClassForDesc(const std::string& descriptor);
+ const VMClass* getClassForDesc(const std::string& descriptor);
const Type* getTypeHelper(const std::string&,
unsigned& i,
bool memberMethod = false) const;
- std::pair insertClass(const Class& clazz) {
+ std::pair insertClass(const VMClass& clazz) {
return classMap_.insert(std::make_pair(clazz.getName(), clazz));
}
- ClassMap::iterator insertClass(ClassMap::iterator i, const Class& clazz) {
+ ClassMap::iterator insertClass(ClassMap::iterator i, const VMClass& clazz) {
return classMap_.insert(i, std::make_pair(clazz.getName(), clazz));
}
- friend class Class;
+ friend class VMClass;
public:
static std::string canonicalizeClassName(const std::string& className) {
@@ -73,13 +73,13 @@
return !isTwoSlotType(type);
}
- const Class* getClass(const std::string& className) {
+ const VMClass* getClass(const std::string& className) {
return getClassForDesc(canonicalizeClassName(className));
}
- const Class* getClass(JType type);
+ const VMClass* getClass(JType type);
- const Class* getArrayClass(const Class* clazz) {
+ const VMClass* getArrayClass(const VMClass* clazz) {
return getClassForDesc('[' + clazz->getName());
}
Index: llvm-java/lib/Compiler/Resolver.cpp
diff -u llvm-java/lib/Compiler/Resolver.cpp:1.5 llvm-java/lib/Compiler/Resolver.cpp:1.6
--- llvm-java/lib/Compiler/Resolver.cpp:1.5 Sat Mar 26 18:04:10 2005
+++ llvm-java/lib/Compiler/Resolver.cpp Mon Mar 28 13:53:24 2005
@@ -27,15 +27,15 @@
objectBaseType_(OpaqueType::get()),
objectBaseRefType_(PointerType::get(objectBaseType_))
{
- insertClass(Class(this, Type::SByteTy));
- insertClass(Class(this, Type::UShortTy));
- insertClass(Class(this, Type::DoubleTy));
- insertClass(Class(this, Type::FloatTy));
- insertClass(Class(this, Type::IntTy));
- insertClass(Class(this, Type::LongTy));
- insertClass(Class(this, Type::ShortTy));
- insertClass(Class(this, Type::BoolTy));
- insertClass(Class(this, Type::VoidTy));
+ insertClass(VMClass(this, Type::SByteTy));
+ insertClass(VMClass(this, Type::UShortTy));
+ insertClass(VMClass(this, Type::DoubleTy));
+ insertClass(VMClass(this, Type::FloatTy));
+ insertClass(VMClass(this, Type::IntTy));
+ insertClass(VMClass(this, Type::LongTy));
+ insertClass(VMClass(this, Type::ShortTy));
+ insertClass(VMClass(this, Type::BoolTy));
+ insertClass(VMClass(this, Type::VoidTy));
module_->addTypeName("struct.llvm_java_object_base", objectBaseType_);
}
@@ -88,7 +88,7 @@
return 0; // not reached
}
-const Class* Resolver::getClassForDesc(const std::string& descriptor)
+const VMClass* Resolver::getClassForDesc(const std::string& descriptor)
{
ClassMap::iterator it = classMap_.lower_bound(descriptor);
if (it == classMap_.end() || it->first != descriptor) {
@@ -108,12 +108,12 @@
case 'L': {
unsigned pos = descriptor.find(';', 1);
const std::string& className = descriptor.substr(1, pos - 1);
- it = insertClass(it, Class(this, className));
+ it = insertClass(it, VMClass(this, className));
break;
}
case '[': {
const std::string& componentDescriptor = descriptor.substr(1);
- it = insertClass(it, Class(this, getClassForDesc(componentDescriptor)));
+ it = insertClass(it, VMClass(this, getClassForDesc(componentDescriptor)));
break;
}
default:
@@ -128,7 +128,7 @@
return &it->second;
}
-const Class* Resolver::getClass(JType type)
+const VMClass* Resolver::getClass(JType type)
{
switch (type) {
case BOOLEAN: return getClassForDesc("Z");
Index: llvm-java/lib/Compiler/Compiler.cpp
diff -u llvm-java/lib/Compiler/Compiler.cpp:1.260 llvm-java/lib/Compiler/Compiler.cpp:1.261
--- llvm-java/lib/Compiler/Compiler.cpp:1.260 Sun Mar 27 20:46:19 2005
+++ llvm-java/lib/Compiler/Compiler.cpp Mon Mar 28 13:53:24 2005
@@ -61,7 +61,7 @@
Module* module_;
std::auto_ptr resolver_;
GlobalVariable* JNIEnvPtr_;
- const Class* class_;
+ const VMClass* class_;
std::auto_ptr bbBuilder_;
std::list bbWorkList_;
typedef std::map OpStackDepthMap;
@@ -93,7 +93,7 @@
static StructType* VTableTy;
static StructType* TypeInfoTy;
};
- typedef std::map Class2VTableInfoMap;
+ typedef std::map Class2VTableInfoMap;
Class2VTableInfoMap c2viMap_;
public:
@@ -191,7 +191,7 @@
new CallInst(memcpy_, params, "", ip);
// Get class information for java/lang/String.
- const Class* clazz = resolver_->getClass("java/lang/String");
+ const VMClass* clazz = resolver_->getClass("java/lang/String");
const VTableInfo* vi = getVTableInfoGeneric(clazz);
// Install the vtable pointer.
@@ -263,7 +263,7 @@
/// VTableInfo for java.lang.Object.
bool initializeVTableInfoMap() {
DEBUG(std::cerr << "Building VTableInfo for: java/lang/Object\n");
- const Class* clazz = resolver_->getClass("java/lang/Object");
+ const VMClass* clazz = resolver_->getClass("java/lang/Object");
VTableInfo& vi = c2viMap_[clazz];
assert(!vi.vtable && vi.m2iMap.empty() &&
@@ -361,7 +361,7 @@
/// its corresponding VTable. The direct superclass goes first in
/// the array.
llvm::Constant*
- buildSuperClassesVTables(const Class* clazz, const VTableInfo& vi) const {
+ buildSuperClassesVTables(const VMClass* clazz, const VTableInfo& vi) const {
std::vector superVtables(vi.superVtables.size());
for (unsigned i = 0, e = vi.superVtables.size(); i != e; ++i)
superVtables[i] = ConstantExpr::getCast(
@@ -387,8 +387,8 @@
/// Builds an interface VTable for the specified
/// pair.
- llvm::Constant* buildInterfaceVTable(const Class* clazz,
- const Class* interface) {
+ llvm::Constant* buildInterfaceVTable(const VMClass* clazz,
+ const VMClass* interface) {
DEBUG(std::cerr << "Building interface vtable: "
<< interface->getName() << " for: " << clazz->getName() << '\n');
@@ -438,8 +438,8 @@
}
void insertVtablesForInterface(std::vector& vtables,
- const Class* clazz,
- const Class* interface) {
+ const VMClass* clazz,
+ const VMClass* interface) {
static llvm::Constant* nullVTable =
llvm::Constant::getNullValue(PointerType::get(VTableInfo::VTableTy));
@@ -455,7 +455,7 @@
/// corresponding VTableInfo. If this classfile is an interface we
/// return a pointer to 0xFFFFFFFF.
std::pair
- buildInterfacesVTables(const Class* clazz, const VTableInfo& vi) {
+ buildInterfacesVTables(const VMClass* clazz, const VTableInfo& vi) {
// If this is an interface then we are not implementing any
// interfaces so the lastInterface field is our index and the
// pointer to the array of interface vtables is an all-ones
@@ -501,7 +501,7 @@
/// Given the classfile and its corresponding VTableInfo,
/// construct the typeinfo constant for it.
- llvm::Constant* buildClassTypeInfo(const Class* clazz,
+ llvm::Constant* buildClassTypeInfo(const VMClass* clazz,
const VTableInfo& vi) {
std::vector typeInfoInit;
@@ -529,7 +529,7 @@
}
/// Returns the VTableInfo associated with this classfile.
- const VTableInfo& getVTableInfo(const Class* clazz) {
+ const VTableInfo& getVTableInfo(const VMClass* clazz) {
static bool initialized = initializeVTableInfoMap();
Class2VTableInfoMap::iterator it = c2viMap_.lower_bound(clazz);
@@ -552,7 +552,7 @@
// this inherits from.
if (clazz->isInterface()) {
for (unsigned i = 0, e = clazz->getNumInterfaces(); i != e; ++i) {
- const Class* interface = clazz->getInterface(i);
+ const VMClass* interface = clazz->getInterface(i);
const VTableInfo& ifaceVI = getVTableInfo(interface);
const ClassFile* ifaceCF = interface->getClassFile();
ConstantStruct* ifaceInit =
@@ -574,7 +574,7 @@
// Otherwise this is a class, so add all methods from its super
// class.
else {
- const Class* superClass = clazz->getSuperClass();
+ const VMClass* superClass = clazz->getSuperClass();
assert(superClass && "Class does not have superclass!");
const VTableInfo& superVI = getVTableInfo(superClass);
@@ -808,9 +808,9 @@
/// Finds a static field in the specified class, any of its
/// super clases, or any of the interfaces it implements.
- GlobalVariable* getStaticField(const Class* clazz,
+ GlobalVariable* getStaticField(const VMClass* clazz,
const std::string& name,
- const Class* fieldClass) {
+ const VMClass* fieldClass) {
emitStaticInitializers(clazz->getClassFile());
std::string globalName =
@@ -821,7 +821,7 @@
return g;
for (unsigned i = 0, e = clazz->getNumInterfaces(); i != e; ++i) {
- const Class* interface = clazz->getInterface(i);
+ const VMClass* interface = clazz->getInterface(i);
emitStaticInitializers(interface->getClassFile());
globalName =
interface->getClassFile()->getThisClass()->getName()->str() +
@@ -832,7 +832,7 @@
}
for (unsigned i = 0, e = clazz->getNumSuperClasses(); i != e; ++i) {
- const Class* superClass = clazz->getSuperClass(i);
+ const VMClass* superClass = clazz->getSuperClass(i);
emitStaticInitializers(superClass->getClassFile());
globalName =
superClass->getClassFile()->getThisClass()->getName()->str() +
@@ -859,7 +859,7 @@
/// Emits the necessary code to get a field from the passed
/// pointer to an object.
- Value* getField(const Class* clazz,
+ Value* getField(const VMClass* clazz,
const std::string& fieldName,
Value* ptr) {
// Cast ptr to correct type.
@@ -1094,14 +1094,14 @@
const std::string& className =
classfile->getThisClass()->getName()->str();
- const Class* clazz = resolver_->getClass(className);
+ const VMClass* clazz = resolver_->getClass(className);
// Create the global variables of this class.
const Fields& fields = classfile->getFields();
for (unsigned i = 0, e = fields.size(); i != e; ++i) {
Field* field = fields[i];
if (field->isStatic()) {
- const Class* fieldClass =
+ const VMClass* fieldClass =
clazz->getClassForDescriptor(field->getDescriptorIndex());
const Type* globalTy = fieldClass->getType();
// A java field can be final/constant even if it has a
@@ -1281,7 +1281,7 @@
void do_saload() { do_aload_common("[S"); }
void do_aload_common(const std::string& className) {
- const Class* arrayClass = resolver_->getClass(className);
+ const VMClass* arrayClass = resolver_->getClass(className);
assert(arrayClass->isArray() && "Not an array class!");
Value* index = pop(Type::IntTy);
Value* arrayRef = pop(arrayClass->getType());
@@ -1318,9 +1318,9 @@
void do_sastore() { do_astore_common("[S"); }
void do_astore_common(const std::string& className) {
- const Class* arrayClass = resolver_->getClass(className);
+ const VMClass* arrayClass = resolver_->getClass(className);
assert(arrayClass->isArray() && "Not an array class!");
- const Class* componentClass = arrayClass->getComponentClass();
+ const VMClass* componentClass = arrayClass->getComponentClass();
Value* value = pop(componentClass->getType());
Value* index = pop(Type::IntTy);
Value* arrayRef = pop(arrayClass->getType());
@@ -1636,7 +1636,7 @@
void do_putfield(unsigned index) {
ConstantFieldRef* fieldRef =
class_->getClassFile()->getConstantFieldRef(index);
- const Class* fieldClass = class_->getClassForDescriptor(
+ const VMClass* fieldClass = class_->getClassForDescriptor(
fieldRef->getNameAndType()->getDescriptorIndex());
const Type* type = fieldClass->getType();
Value* v = pop(type);
@@ -1669,11 +1669,11 @@
return params;
}
- const VTableInfo* getVTableInfoGeneric(const Class* clazz) {
+ const VTableInfo* getVTableInfoGeneric(const VMClass* clazz) {
assert(!clazz->isPrimitive() &&
"Cannot get VTableInfo for primitive class!");
if (clazz->isArray()) {
- const Class* componentClass = clazz->getComponentClass();
+ const VMClass* componentClass = clazz->getComponentClass();
if (componentClass->isPrimitive())
return &getPrimitiveArrayVTableInfo(componentClass->getType());
else
@@ -1690,7 +1690,8 @@
const std::string& className = methodRef->getClass()->getName()->str();
- const Class* clazz = class_->getClassForClass(methodRef->getClassIndex());
+ const VMClass* clazz =
+ class_->getClassForClass(methodRef->getClassIndex());
const VTableInfo* vi = getVTableInfoGeneric(clazz);
const std::string& methodDescr =
@@ -1732,7 +1733,8 @@
const std::string& methodDescr =
methodName + nameAndType->getDescriptor()->str();
std::string funcName = className + '/' + methodDescr;
- const Class* clazz = class_->getClassForClass(methodRef->getClassIndex());
+ const VMClass* clazz =
+ class_->getClassForClass(methodRef->getClassIndex());
const FunctionType* funcTy = cast(
resolver_->getType(nameAndType->getDescriptor()->str(), true));
@@ -1744,7 +1746,8 @@
void do_invokestatic(unsigned index) {
ConstantMethodRef* methodRef =
class_->getClassFile()->getConstantMethodRef(index);
- const Class* clazz = class_->getClassForClass(methodRef->getClassIndex());
+ const VMClass* clazz =
+ class_->getClassForClass(methodRef->getClassIndex());
emitStaticInitializers(clazz->getClassFile());
Method* method = getMethod(methodRef);
Function* function = getFunction(method);
@@ -1771,7 +1774,8 @@
const std::string& className = methodRef->getClass()->getName()->str();
- const Class* clazz = class_->getClassForClass(methodRef->getClassIndex());
+ const VMClass* clazz =
+ class_->getClassForClass(methodRef->getClassIndex());
const VTableInfo* vi = getVTableInfoGeneric(clazz);
const std::string& methodDescr =
@@ -1822,7 +1826,7 @@
}
template
- Value* allocateObject(const Class& clazz,
+ Value* allocateObject(const VMClass& clazz,
const VTableInfo& vi,
InsertionPointTy* ip) {
static std::vector params(4);
@@ -1844,7 +1848,7 @@
}
void do_new(unsigned index) {
- const Class* clazz = class_->getClassForClass(index);
+ const VMClass* clazz = class_->getClassForClass(index);
emitStaticInitializers(clazz->getClassFile());
const VTableInfo& vi = getVTableInfo(clazz);
@@ -1872,14 +1876,14 @@
}
template
- Value* allocateArray(const Class* clazz,
+ Value* allocateArray(const VMClass* clazz,
const VTableInfo* vi,
Value* count,
InsertionPointTy* ip) {
static std::vector params(4);
assert(clazz->isArray() && "Not an array class!");
- const Class* componentClass = clazz->getComponentClass();
+ const VMClass* componentClass = clazz->getComponentClass();
const Type* elementTy = componentClass->getType();
// The size of the element.
@@ -1923,8 +1927,8 @@
void do_newarray(JType type) {
Value* count = pop(Type::UIntTy);
- const Class* clazz = resolver_->getClass(type);
- const Class* arrayClass = resolver_->getArrayClass(clazz);
+ const VMClass* clazz = resolver_->getClass(type);
+ const VMClass* arrayClass = resolver_->getArrayClass(clazz);
const VTableInfo* vi = getVTableInfoGeneric(arrayClass);
push(allocateArray(arrayClass, vi, count, currentBB_));
@@ -1933,15 +1937,15 @@
void do_anewarray(unsigned index) {
Value* count = pop(Type::UIntTy);
- const Class* clazz = class_->getClassForClass(index);
- const Class* arrayClass = resolver_->getArrayClass(clazz);
+ const VMClass* clazz = class_->getClassForClass(index);
+ const VMClass* arrayClass = resolver_->getArrayClass(clazz);
const VTableInfo* vi = getVTableInfoGeneric(arrayClass);
push(allocateArray(arrayClass, vi, count, currentBB_));
}
void do_arraylength() {
- const Class* clazz = resolver_->getClass("[Ljava/lang/Object;");
+ const VMClass* clazz = resolver_->getClass("[Ljava/lang/Object;");
Value* arrayRef = pop(clazz->getType());
Value* lengthPtr = getArrayLengthPtr(arrayRef, currentBB_);
Value* length = new LoadInst(lengthPtr, TMP, currentBB_);
@@ -1955,7 +1959,7 @@
}
void do_checkcast(unsigned index) {
- const Class* clazz = class_->getClassForClass(index);
+ const VMClass* clazz = class_->getClassForClass(index);
const VTableInfo* vi = getVTableInfoGeneric(clazz);
Value* objRef = pop(resolver_->getObjectBaseRefType());
@@ -1972,7 +1976,7 @@
}
void do_instanceof(unsigned index) {
- const Class* clazz = class_->getClassForClass(index);
+ const VMClass* clazz = class_->getClassForClass(index);
const VTableInfo* vi = getVTableInfoGeneric(clazz);
Value* objRef = pop(resolver_->getObjectBaseRefType());
From alkis at cs.uiuc.edu Mon Mar 28 13:55:53 2005
From: alkis at cs.uiuc.edu (Alkis Evlogimenos)
Date: Mon, 28 Mar 2005 13:55:53 -0600
Subject: [llvm-commits] CVS: llvm-java/lib/Compiler/VMClass.h
Message-ID: <200503281955.NAA01964@zion.cs.uiuc.edu>
Changes in directory llvm-java/lib/Compiler:
VMClass.h updated: 1.13 -> 1.14
---
Log message:
Some minor changes left behind after the rename.
---
Diffs of the changes: (+4 -4)
VMClass.h | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
Index: llvm-java/lib/Compiler/VMClass.h
diff -u llvm-java/lib/Compiler/VMClass.h:1.13 llvm-java/lib/Compiler/VMClass.h:1.14
--- llvm-java/lib/Compiler/VMClass.h:1.13 Mon Mar 28 13:53:24 2005
+++ llvm-java/lib/Compiler/VMClass.h Mon Mar 28 13:55:42 2005
@@ -7,13 +7,13 @@
//
//===----------------------------------------------------------------------===//
//
-// This file contains the declaration of the Class class that represents a
+// This file contains the declaration of the VMClass class that represents a
// compile time representation of a Java class (java.lang.Class).
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_JAVA_CLASS_H
-#define LLVM_JAVA_CLASS_H
+#ifndef LLVM_JAVA_VMCLASS_H
+#define LLVM_JAVA_VMCLASS_H
#include
#include
@@ -94,4 +94,4 @@
} } // namespace llvm::Java
-#endif//LLVM_JAVA_CLASS_H
+#endif//LLVM_JAVA_VMCLASS_H
From alenhar2 at cs.uiuc.edu Mon Mar 28 14:06:05 2005
From: alenhar2 at cs.uiuc.edu (Andrew Lenharth)
Date: Mon, 28 Mar 2005 14:06:05 -0600
Subject: [llvm-commits] CVS: llvm/docs/LangRef.html
Message-ID: <200503282006.j2SK6531012790@apoc.cs.uiuc.edu>
Changes in directory llvm/docs:
LangRef.html updated: 1.90 -> 1.91
---
Log message:
First step in adding pcmarker intrinsic. Second step (soon) is adding backend support.
---
Diffs of the changes: (+42 -1)
LangRef.html | 43 ++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 42 insertions(+), 1 deletion(-)
Index: llvm/docs/LangRef.html
diff -u llvm/docs/LangRef.html:1.90 llvm/docs/LangRef.html:1.91
--- llvm/docs/LangRef.html:1.90 Mon Mar 7 16:13:59 2005
+++ llvm/docs/LangRef.html Mon Mar 28 14:05:48 2005
@@ -126,6 +126,7 @@
'llvm.returnaddress' Intrinsic
'llvm.frameaddress' Intrinsic
'llvm.prefetch' Intrinsic
+ 'llvm.pcmarker' Intrinsic
Operating System Intrinsics
@@ -2548,6 +2549,46 @@
+
+
+
+
+
+
Syntax:
+
+ call void (uint)* %llvm.pcmarker( uint <id> )
+
+
+
Overview:
+
+
+
+The 'llvm.pcmarker' intrinsic is a method to export a PC in a region of
+code to simulators and other tools. The method is target specific, but it is
+expected that the marker will use exported symbols to transmit the PC of the marker.
+The marker makes no guaranties that it will remain with any specific instruction
+after optimizations. It is possible that the presense of a marker will inhibit
+optimizations. The intended use is to be inserted after optmizations to allow
+corrolations of simulation runs.
+
+
+
Arguments:
+
+
+id is a numerical id identifying the marker.
+
+
+
Semantics:
+
+
+This intrinsic does not modify the behavior of the program. Backends that do not
+support this intrinisic may ignore it.
+
+
+
+