[PATCH] D31304: [MetaRenamer] Don't rename library functions.
Davide Italiano via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 23 14:28:10 PDT 2017
davide accepted this revision.
davide added a comment.
This revision is now accepted and ready to land.
Oh, sure. Sounds sensible (modulo nits).
================
Comment at: lib/Transforms/Utils/MetaRenamer.cpp:118-122
StringRef Name = F.getName();
- if (Name.startswith("llvm.") || (!Name.empty() && Name[0] == 1))
+ LibFunc Tmp;
+ if (Name.startswith("llvm.") || (!Name.empty() && Name[0] == 1) ||
+ TLI.getLibFunc(F, Tmp))
continue;
----------------
Add a comment explaining why you're skipping funcs.
================
Comment at: test/Transforms/MetaRenamer/metarenamer.ll:104-105
+define void @dont_rename_lib_funcs() {
+; CHECK: call i8* @malloc
+; CHECK: call void @free
+ %x = call i8* @malloc(i32 23)
----------------
```
; CHECK-LABEL:
; CHECK-NEXT:
; CHECK-NEXT:
```
Repository:
rL LLVM
https://reviews.llvm.org/D31304
More information about the llvm-commits
mailing list