[llvm] r326731 - [llvm-pdbdump] Dump restrict type qualifier

Galina Kistanova via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 6 15:31:37 PST 2018


By the way, you can configure your git to use this for binary diff if you
would define an external diff driver. To do so add a section to your
$GIT_DIR/config file (or $HOME/.gitconfig file) similar to this:

[diff "bin"]
    textconv = xxd

Thanks

Galina


On Tue, Mar 6, 2018 at 3:20 PM, Galina Kistanova <gkistanova at gmail.com>
wrote:

> Hi Aaron,
>
> Thanks for fixing that!
>
> > What is the command you use to create a diff?
>
> Usually, one would hex dump first and then diff like regular text files,
> maybe side-by-side. Something like this:
>
> $ diff -y <(xxd foo1.bin) <(xxd foo2.bin)
>
> You can configure your git to use this for binary diff in the
>
> If the binary files are large, limit would help dumping just chunk by
> chunk.
>
> Thanks
>
> Galina
>
>
>
>
> On Tue, Mar 6, 2018 at 11:24 AM, Aaron Smith <aaron.smith at microsoft.com>
> wrote:
>
>> Hi Galina,
>>
>>
>>
>> Thanks for letting me know. It’s because the pdb is 0 bytes. I will push
>> the correct binary.
>>
>>
>>
>> What is the command you use to create a diff? My way doesn’t work with
>> binary files apparently.
>>
>>
>>
>> git diff -U999999 master > mypatch.diff
>>
>>
>>
>> thanks,
>>
>> Aaron
>>
>>
>>
>> *From: *Galina Kistanova <gkistanova at gmail.com>
>> *Date: *Tuesday, March 6, 2018 at 11:11 AM
>> *To: *Aaron Smith <aaron.smith at microsoft.com>
>> *Cc: *Artur Pilipenko via llvm-commits <llvm-commits at lists.llvm.org>
>> *Subject: *Re: [llvm] r326731 - [llvm-pdbdump] Dump restrict type
>> qualifier
>>
>>
>>
>> Hello Aaron,
>>
>> One of added tests broke few builders:
>>
>> http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-
>> scei-ps4-windows10pro-fast/builds/15737
>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flab.llvm.org%3A8011%2Fbuilders%2Fllvm-clang-lld-x86_64-scei-ps4-windows10pro-fast%2Fbuilds%2F15737&data=04%7C01%7Caaron.smith%40microsoft.com%7Ce5960a00bc4749cf335a08d583960ae7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636559602813685633%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-2&sdata=kg5SrR5A%2BvVTjzEcjNLA5FAc2IDJxEtQX8RpM5dBtWw%3D&reserved=0>
>> http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win
>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flab.llvm.org%3A8011%2Fbuilders%2Fllvm-clang-x86_64-expensive-checks-win&data=04%7C01%7Caaron.smith%40microsoft.com%7Ce5960a00bc4749cf335a08d583960ae7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636559602813685633%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-2&sdata=LzGWUDLDn6j%2Fh2pvwVknMmyZ4zKSD08UEWH%2Btzvjgu0%3D&reserved=0>
>>
>> Failing Tests (3):
>> . . .
>>     LLVM :: tools/llvm-pdbdump/type-qualifiers.test
>>
>> Please have a look?
>>
>> Thanks
>>
>> Galina
>>
>>
>>
>> On Mon, Mar 5, 2018 at 10:29 AM, Aaron Smith via llvm-commits <
>> llvm-commits at lists.llvm.org> wrote:
>>
>> Author: asmith
>> Date: Mon Mar  5 10:29:43 2018
>> New Revision: 326731
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=326731&view=rev
>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%3Frev%3D326731%26view%3Drev&data=04%7C01%7Caaron.smith%40microsoft.com%7Ce5960a00bc4749cf335a08d583960ae7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636559602813685633%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-2&sdata=vRhZ9g2Gr%2BtrbZH6aL074MRjybbVXqZ78g5G%2FEYX570%3D&reserved=0>
>> Log:
>> [llvm-pdbdump] Dump restrict type qualifier
>>
>> Reviewers: zturner, llvm-commits, rnk
>>
>> Reviewed By: zturner
>>
>> Subscribers: majnemer
>>
>> Differential Revision: https://reviews.llvm.org/D43639
>> <https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD43639&data=04%7C01%7Caaron.smith%40microsoft.com%7Ce5960a00bc4749cf335a08d583960ae7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636559602813695632%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-2&sdata=q7f0ftQbJbg56yHIEuHFq5F%2BfjOlQQUWtlR9crACI1E%3D&reserved=0>
>>
>> Added:
>>     llvm/trunk/test/tools/llvm-pdbdump/Inputs/TypeQualifiersTest.cpp
>>     llvm/trunk/test/tools/llvm-pdbdump/Inputs/TypeQualifiersTest.pdb
>>     llvm/trunk/test/tools/llvm-pdbdump/type-qualifiers.test
>> Modified:
>>     llvm/trunk/tools/llvm-pdbutil/PrettyFunctionDumper.cpp
>>     llvm/trunk/tools/llvm-pdbutil/PrettyTypedefDumper.cpp
>>     llvm/trunk/tools/llvm-pdbutil/PrettyVariableDumper.cpp
>>
>> Added: llvm/trunk/test/tools/llvm-pdbdump/Inputs/TypeQualifiersTest.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/ll
>> vm-pdbdump/Inputs/TypeQualifiersTest.cpp?rev=326731&view=auto
>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%2Fllvm%2Ftrunk%2Ftest%2Ftools%2Fllvm-pdbdump%2FInputs%2FTypeQualifiersTest.cpp%3Frev%3D326731%26view%3Dauto&data=04%7C01%7Caaron.smith%40microsoft.com%7Ce5960a00bc4749cf335a08d583960ae7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636559602813695632%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-2&sdata=Kd8voF32zioDi8y1q6xHvGh%2BcdFKR6sf2Jvio%2F%2Bwv8A%3D&reserved=0>
>> ============================================================
>> ==================
>> --- llvm/trunk/test/tools/llvm-pdbdump/Inputs/TypeQualifiersTest.cpp
>> (added)
>> +++ llvm/trunk/test/tools/llvm-pdbdump/Inputs/TypeQualifiersTest.cpp Mon
>> Mar  5 10:29:43 2018
>> @@ -0,0 +1,55 @@
>> +// Compile with "cl /c /Zi /GR- TypeQualifiersTest.cpp"
>> +// Link with "link TypeQualifiersTest.obj /debug /nodefaultlib
>> /entry:main"
>> +
>> +union Union {
>> +  int * __restrict x_member;
>> +  float * __restrict y_member;
>> +  int* volatile __restrict m_volatile;
>> +  const char* m_const;
>> +};
>> +
>> +int f(const volatile int* __restrict arg_crv) {
>> +  Union u;
>> +  return 1;
>> +}
>> +
>> +void g(int& __restrict arg_ref) {
>> +}
>> +
>> +namespace NS {
>> +  class Class {
>> +  public:
>> +    int get() const { return 1;}
>> +    int set() __restrict { return 2; }
>> +    void help() volatile { return; }
>> +  };
>> +
>> +  struct Foo {
>> +    int a;
>> +    int b;
>> +    int func(int x) __restrict { return 1; }
>> +  };
>> +
>> +  Foo s = { 10 };
>> +
>> +  const int* __restrict p_object = &s.a;
>> +
>> +  volatile int Foo:: * __restrict p_data_member = &Foo::a;
>> +
>> +  int (Foo::* p_member_func)(int) __restrict = &Foo::func;
>> +}
>> +
>> +typedef long* __restrict RestrictTypedef;
>> +RestrictTypedef RestrictVar;
>> +
>> +typedef volatile int* __restrict RankNArray[10][100];
>> +RankNArray ArrayVar;
>> +
>> +int main() {
>> +  NS::Class ClassVar;
>> +  ClassVar.get();
>> +  ClassVar.help();
>> +  ClassVar.set();
>> +
>> +  return 0;
>> +}
>>
>> Added: llvm/trunk/test/tools/llvm-pdbdump/Inputs/TypeQualifiersTest.pdb
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/ll
>> vm-pdbdump/Inputs/TypeQualifiersTest.pdb?rev=326731&view=auto
>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%2Fllvm%2Ftrunk%2Ftest%2Ftools%2Fllvm-pdbdump%2FInputs%2FTypeQualifiersTest.pdb%3Frev%3D326731%26view%3Dauto&data=04%7C01%7Caaron.smith%40microsoft.com%7Ce5960a00bc4749cf335a08d583960ae7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636559602813695632%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-2&sdata=Q%2FYBFVJqreahX33AKUnGVX3sJrcew7p1wmeo3ZmQpy0%3D&reserved=0>
>> ============================================================
>> ==================
>>     (empty)
>>
>> Added: llvm/trunk/test/tools/llvm-pdbdump/type-qualifiers.test
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/ll
>> vm-pdbdump/type-qualifiers.test?rev=326731&view=auto
>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%2Fllvm%2Ftrunk%2Ftest%2Ftools%2Fllvm-pdbdump%2Ftype-qualifiers.test%3Frev%3D326731%26view%3Dauto&data=04%7C01%7Caaron.smith%40microsoft.com%7Ce5960a00bc4749cf335a08d583960ae7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636559602813695632%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-2&sdata=LZHfoD%2BDiZzr8nmaQYZeZKbPuISQ6RPjyPsJUxQUSzs%3D&reserved=0>
>> ============================================================
>> ==================
>> --- llvm/trunk/test/tools/llvm-pdbdump/type-qualifiers.test (added)
>> +++ llvm/trunk/test/tools/llvm-pdbdump/type-qualifiers.test Mon Mar  5
>> 10:29:43 2018
>> @@ -0,0 +1,25 @@
>> +; RUN: llvm-pdbutil pretty -all -class-recurse-depth=1 \
>> +; RUN:   %p/Inputs/TypeQualifiersTest.pdb > %t
>> +; RUN: FileCheck -input-file=%t %s -check-prefix=GLOBALS_FUNC
>> +; RUN: FileCheck -input-file=%t %s -check-prefix=GLOBALS_DATA
>> +; RUN: FileCheck -input-file=%t %s -check-prefix=QUALS
>> +
>> +; GLOBALS_FUNC: ---GLOBALS---
>> +; GLOBALS_FUNC-DAG: int __cdecl f(const volatile int* __restrict arg_crv)
>> +; GLOBALS_FUNC-DAG: void __cdecl g(int& __restrict arg_ref)
>> +
>> +; GLOBALS_DATA: ---GLOBALS---
>> +; GLOBALS_DATA-DAG: static volatile int* __restrict ArrayVar[10][100]
>> +; GLOBALS_DATA-DAG: static long* __restrict RestrictVar
>> +; GLOBALS_DATA-DAG: static const int* __restrict NS::p_object
>> +; GLOBALS_DATA-DAG: static NS::Foo NS::s
>> +; GLOBALS_DATA-DAG: static volatile int* __restrict NS::p_data_member
>> +
>> +; QUALS: ---TYPES---
>> +; QUALS-DAG: typedef RankNArray
>> +; QUALS-DAG: typedef long* __restrict RestrictTypedef
>> +; QUALS: union Union
>> +; QUALS-DAG: int* __restrict x_member
>> +; QUALS-DAG: float* __restrict y_member
>> +; QUALS-DAG: int* volatile __restrict m_volatile
>> +; QUALS-DAG: const char* m_const
>>
>> Modified: llvm/trunk/tools/llvm-pdbutil/PrettyFunctionDumper.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pd
>> butil/PrettyFunctionDumper.cpp?rev=326731&r1=326730&r2=326731&view=diff
>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%2Fllvm%2Ftrunk%2Ftools%2Fllvm-pdbutil%2FPrettyFunctionDumper.cpp%3Frev%3D326731%26r1%3D326730%26r2%3D326731%26view%3Ddiff&data=04%7C01%7Caaron.smith%40microsoft.com%7Ce5960a00bc4749cf335a08d583960ae7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636559602813695632%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-2&sdata=Hegbc3Ds4vKsScZdg%2FettNUzCEyifw3v77qRGQZwP74%3D&reserved=0>
>> ============================================================
>> ==================
>> --- llvm/trunk/tools/llvm-pdbutil/PrettyFunctionDumper.cpp (original)
>> +++ llvm/trunk/tools/llvm-pdbutil/PrettyFunctionDumper.cpp Mon Mar  5
>> 10:29:43 2018
>> @@ -252,6 +252,9 @@ void FunctionDumper::dump(const PDBSymbo
>>        WithColor(Printer, PDB_ColorItem::Keyword).get() << "volatile ";
>>      PointeeType->dump(*this);
>>      Printer << (Symbol.isReference() ? "&" : "*");
>> +
>> +    if (Symbol.getRawSymbol().isRestrictedType())
>> +      WithColor(Printer, PDB_ColorItem::Keyword).get() << " __restrict";
>>    }
>>  }
>>
>>
>> Modified: llvm/trunk/tools/llvm-pdbutil/PrettyTypedefDumper.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pd
>> butil/PrettyTypedefDumper.cpp?rev=326731&r1=326730&r2=326731&view=diff
>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%2Fllvm%2Ftrunk%2Ftools%2Fllvm-pdbutil%2FPrettyTypedefDumper.cpp%3Frev%3D326731%26r1%3D326730%26r2%3D326731%26view%3Ddiff&data=04%7C01%7Caaron.smith%40microsoft.com%7Ce5960a00bc4749cf335a08d583960ae7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636559602813695632%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-2&sdata=ZRYqgnFpCgsbI%2B7NdL%2Fz%2FGkDuaQeOKfnYaGP%2FXykweQ%3D&reserved=0>
>> ============================================================
>> ==================
>> --- llvm/trunk/tools/llvm-pdbutil/PrettyTypedefDumper.cpp (original)
>> +++ llvm/trunk/tools/llvm-pdbutil/PrettyTypedefDumper.cpp Mon Mar  5
>> 10:29:43 2018
>> @@ -63,6 +63,9 @@ void TypedefDumper::dump(const PDBSymbol
>>      PointeeType->dump(*this);
>>      Printer << ((Symbol.isReference()) ? "&" : "*");
>>    }
>> +
>> +  if (Symbol.getRawSymbol().isRestrictedType())
>> +    WithColor(Printer, PDB_ColorItem::Keyword).get() << " __restrict";
>>  }
>>
>>  void TypedefDumper::dump(const PDBSymbolTypeFunctionSig &Symbol) {
>>
>> Modified: llvm/trunk/tools/llvm-pdbutil/PrettyVariableDumper.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pd
>> butil/PrettyVariableDumper.cpp?rev=326731&r1=326730&r2=326731&view=diff
>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fllvm.org%2Fviewvc%2Fllvm-project%2Fllvm%2Ftrunk%2Ftools%2Fllvm-pdbutil%2FPrettyVariableDumper.cpp%3Frev%3D326731%26r1%3D326730%26r2%3D326731%26view%3Ddiff&data=04%7C01%7Caaron.smith%40microsoft.com%7Ce5960a00bc4749cf335a08d583960ae7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636559602813695632%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-2&sdata=A4v1%2FGFbjtUKDBHe1n3zx84%2BlOTTvb38AVu%2B4qXtdVs%3D&reserved=0>
>> ============================================================
>> ==================
>> --- llvm/trunk/tools/llvm-pdbutil/PrettyVariableDumper.cpp (original)
>> +++ llvm/trunk/tools/llvm-pdbutil/PrettyVariableDumper.cpp Mon Mar  5
>> 10:29:43 2018
>> @@ -169,6 +169,9 @@ void VariableDumper::dumpRight(const PDB
>>      WithColor(Printer, PDB_ColorItem::Keyword).get() << " const";
>>    if (Symbol.isVolatileType())
>>      WithColor(Printer, PDB_ColorItem::Keyword).get() << " volatile";
>> +
>> +  if (Symbol.getRawSymbol().isRestrictedType())
>> +    WithColor(Printer, PDB_ColorItem::Keyword).get() << " __restrict";
>>  }
>>
>>  void VariableDumper::dump(const PDBSymbolTypePointer &Symbol) {
>> @@ -189,6 +192,9 @@ void VariableDumper::dump(const PDBSymbo
>>      WithColor(Printer, PDB_ColorItem::Keyword).get() << " const ";
>>    if (Symbol.isVolatileType())
>>      WithColor(Printer, PDB_ColorItem::Keyword).get() << " volatile ";
>> +
>> +  if (Symbol.getRawSymbol().isRestrictedType())
>> +    WithColor(Printer, PDB_ColorItem::Keyword).get() << " __restrict ";
>>  }
>>
>>  void VariableDumper::dumpRight(const PDBSymbolTypePointer &Symbol) {
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>> <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.llvm.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fllvm-commits&data=04%7C01%7Caaron.smith%40microsoft.com%7Ce5960a00bc4749cf335a08d583960ae7%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636559602813695632%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-2&sdata=XXxhz6bNK%2FvQITRz9RKSI8lLHGsMP0Y1cfWf488S6mU%3D&reserved=0>
>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180306/5237dcd1/attachment.html>


More information about the llvm-commits mailing list