[llvm-dev] cross-checking external declarations / debug info for declarations

David Callahan via llvm-dev llvm-dev at lists.llvm.org
Fri Dec 9 09:52:15 PST 2016


Great, thanks Adrian, I will try it.

On 12/9/16, 9:00 AM, "aprantl at apple.com on behalf of Adrian Prantl"
<aprantl at apple.com> wrote:

>
>> On Dec 8, 2016, at 7:43 AM, David Callahan via llvm-dev
>><llvm-dev at lists.llvm.org> wrote:
>> 
>> I am interested in putting together a tool which can verify that an
>>external declaration conforms with the actual definition.
>> 
>> A.c:
>> extern int32_t foo();
>> Int bar() { return foo(); }
>> 
>> B.c:
>> int64_t foo() {  Š }
>> 
>> I had thought that I could use the debug information but the debug
>>information in A.o does not include the type of the declaration ³foo²,
>>just the type of bar.
>> 
>> Is there a way to include declarations as well as definitions such as a
>>above? It appears there is a notion of ³retained² types, perhaps I add a
>>flag to retain declarations?
>
>You should take a look at
>
>https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D185
>65&d=DgIFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=lFyiPUrFdOHdaobP7i4hoA&m=KSgUa2B5f2
>BhzgOkgNpRGZB7wwdvfbqiR6RLLzxJIxc&s=-wOXH9x17xU-PsJHUesmsXqyb0iiHgL4h8WoAg
>rKq20&e= 
>
>which implements (almost?) all that you're asking for.
>
>-- adrian
>
>> 
>> Perhaps a different approach?
>> 
>> Thanks
>> ‹david
>> 
>> 
>> 
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> 
>>https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2D
>>bin_mailman_listinfo_llvm-2Ddev&d=DgIFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=lFyiP
>>UrFdOHdaobP7i4hoA&m=KSgUa2B5f2BhzgOkgNpRGZB7wwdvfbqiR6RLLzxJIxc&s=Vty1myn
>>O85AFVwSB_Xtx8mgNl__zibErYfYUZYZpmF0&e=
>



More information about the llvm-dev mailing list