rtrieu added inline comments.

================
Comment at: clang/lib/AST/ODRHash.cpp:73
     AddBoolean(S.isUnarySelector());
     unsigned NumArgs = S.getNumArgs();
     for (unsigned i = 0; i < NumArgs; ++i) {
----------------
There's actually a second bug here as well.  When processing an arbitrary 
number of elements, the number of elements needs to placed before the list.  
This line should be added before the for-loop:

```
ID.AddInteger(NumArgs);

```
This change isn't directly related to your original patch, so feel free to skip 
it.


================
Comment at: clang/lib/AST/ODRHash.cpp:75
     for (unsigned i = 0; i < NumArgs; ++i) {
-      AddIdentifierInfo(S.getIdentifierInfoForSlot(i));
+      ID.AddString(S.getNameForSlot(i));
     }
----------------
For possibly null pointers, ODRHash uses a boolean before processing the 
pointer.  The way to fix this is:

```
const IdentifierInfo *II = S.getIdentifierInfoForSlot(i);
AddBoolean(II)
if (II) {
  AddIdentifierInfo(II);
}
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63789/new/

https://reviews.llvm.org/D63789



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to