summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-upgrade/UpgradeParser.y.cvs
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-03-21 17:27:53 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-03-21 17:27:53 +0000
commit2f8fa50bb36f771a8ce0c5ef7a81a59f650d2688 (patch)
treee4f4f299d800f4954328656beb7d50f835fc0193 /llvm/tools/llvm-upgrade/UpgradeParser.y.cvs
parent20337a5e767401945653e22912aa920f36590d5d (diff)
downloadbcm5719-llvm-2f8fa50bb36f771a8ce0c5ef7a81a59f650d2688.tar.gz
bcm5719-llvm-2f8fa50bb36f771a8ce0c5ef7a81a59f650d2688.zip
Regenerate.
llvm-svn: 35237
Diffstat (limited to 'llvm/tools/llvm-upgrade/UpgradeParser.y.cvs')
-rw-r--r--llvm/tools/llvm-upgrade/UpgradeParser.y.cvs24
1 files changed, 10 insertions, 14 deletions
diff --git a/llvm/tools/llvm-upgrade/UpgradeParser.y.cvs b/llvm/tools/llvm-upgrade/UpgradeParser.y.cvs
index 9dabc23d751..ab06bb4789b 100644
--- a/llvm/tools/llvm-upgrade/UpgradeParser.y.cvs
+++ b/llvm/tools/llvm-upgrade/UpgradeParser.y.cvs
@@ -2936,25 +2936,21 @@ FunctionHeaderH
CurModule.RenameMap[Key] = Conflict->getName();
Fn = new Function(FT, CurFun.Linkage, FunctionName, M);
InsertValue(Fn, CurModule.Values);
- } else if (CurFun.Linkage == GlobalValue::InternalLinkage) {
- // We can safely rename the function we're defining
- std::string NewName = makeNameUnique(FunctionName);
- Fn = new Function(FT, CurFun.Linkage, NewName, M);
- InsertValue(Fn, CurModule.Values);
- RenameMapKey Key = makeRenameMapKey(FunctionName, PFT, ID.S);
- CurModule.RenameMap[Key] = NewName;
- } else {
+ } else {
// We can't quietly rename either of these things, but we must
- // rename one of them. Generate a warning about the renaming and
- // elect to rename the thing we're now defining.
+ // rename one of them. Only if the function's linkage is internal can
+ // we forgo a warning message about the renamed function.
std::string NewName = makeNameUnique(FunctionName);
- warning("Renaming function '" + FunctionName + "' as '" + NewName +
- "' may cause linkage errors");
+ if (CurFun.Linkage != GlobalValue::InternalLinkage) {
+ warning("Renaming function '" + FunctionName + "' as '" + NewName +
+ "' may cause linkage errors");
+ }
+ // Elect to rename the thing we're now defining.
Fn = new Function(FT, CurFun.Linkage, NewName, M);
InsertValue(Fn, CurModule.Values);
RenameMapKey Key = makeRenameMapKey(FunctionName, PFT, ID.S);
CurModule.RenameMap[Key] = NewName;
- }
+ }
} else {
// There's no conflict, just define the function
Fn = new Function(FT, CurFun.Linkage, FunctionName, M);
@@ -3005,7 +3001,7 @@ BEGIN
;
FunctionHeader
- : OptLinkage FunctionHeaderH BEGIN {
+ : OptLinkage { CurFun.Linkage = $1; } FunctionHeaderH BEGIN {
$$ = CurFun.CurrentFunction;
// Make sure that we keep track of the linkage type even if there was a
OpenPOWER on IntegriCloud