[llvm-commits] CVS: llvm-java/lib/Compiler/Compiler.cpp
Alkis Evlogimenos
alkis at cs.uiuc.edu
Wed Nov 17 12:53:34 PST 2004
Changes in directory llvm-java/lib/Compiler:
Compiler.cpp updated: 1.146 -> 1.147
---
Log message:
Map "_" to "_1" when mangling names for JNI calls.
---
Diffs of the changes: (+6 -1)
Index: llvm-java/lib/Compiler/Compiler.cpp
diff -u llvm-java/lib/Compiler/Compiler.cpp:1.146 llvm-java/lib/Compiler/Compiler.cpp:1.147
--- llvm-java/lib/Compiler/Compiler.cpp:1.146 Wed Nov 17 12:57:56 2004
+++ llvm-java/lib/Compiler/Compiler.cpp Wed Nov 17 14:53:24 2004
@@ -1185,7 +1185,12 @@
funcName += '_';
const std::string& methodName = method->getName()->str();
- funcName += methodName;
+ for (unsigned i = 0, e = methodName.size(); i != e; ++i) {
+ if (funcName[i] == '_')
+ funcName += "_1";
+ else
+ funcName += methodName[i];
+ }
Function* jniFunction = module_.getOrInsertFunction(funcName, funcTy);
jniFunction->setLinkage(method->isPrivate() ?
More information about the llvm-commits
mailing list