Page MenuHomePhabricator

zahiraam (Zahira Ammarguellat)
User

Projects

User does not belong to any projects.

User Details

User Since
Apr 14 2017, 11:28 AM (267 w, 23 h)

Recent Activity

Apr 21 2022

zahiraam updated the diff for D124095: [WIP] Experimental changes.
Apr 21 2022, 4:29 AM · Restricted Project

Apr 20 2022

zahiraam added inline comments to D124033: [NFC] Adding a note about the macro __FLT_EVAL_METHOD__.
Apr 20 2022, 2:35 PM · Restricted Project, Restricted Project
zahiraam updated the diff for D124033: [NFC] Adding a note about the macro __FLT_EVAL_METHOD__.
Apr 20 2022, 2:34 PM · Restricted Project, Restricted Project
zahiraam updated the summary of D123630: [WIP] Remove connection between 'ffast-math' and 'ffp-contract'..
Apr 20 2022, 9:07 AM · Restricted Project, Restricted Project
zahiraam requested review of D124095: [WIP] Experimental changes.
Apr 20 2022, 8:42 AM · Restricted Project

Apr 19 2022

zahiraam requested review of D124033: [NFC] Adding a note about the macro __FLT_EVAL_METHOD__.
Apr 19 2022, 12:09 PM · Restricted Project, Restricted Project
zahiraam abandoned D124004: Define __FLT_EVAL_METHOD__ when input source is stdin..
Apr 19 2022, 11:39 AM · Restricted Project, Restricted Project
zahiraam added inline comments to D124004: Define __FLT_EVAL_METHOD__ when input source is stdin..
Apr 19 2022, 11:39 AM · Restricted Project, Restricted Project
zahiraam added inline comments to D124004: Define __FLT_EVAL_METHOD__ when input source is stdin..
Apr 19 2022, 10:43 AM · Restricted Project, Restricted Project
zahiraam updated subscribers of D124004: Define __FLT_EVAL_METHOD__ when input source is stdin..
Apr 19 2022, 10:14 AM · Restricted Project, Restricted Project
zahiraam requested review of D124004: Define __FLT_EVAL_METHOD__ when input source is stdin..
Apr 19 2022, 7:05 AM · Restricted Project, Restricted Project

Apr 13 2022

zahiraam retitled D123630: [WIP] Remove connection between 'ffast-math' and 'ffp-contract'. from Remove connection between 'ffast-math' and 'ffp-contract'. to [WIP] Remove connection between 'ffast-math' and 'ffp-contract'..
Apr 13 2022, 6:38 AM · Restricted Project, Restricted Project

Apr 12 2022

zahiraam requested review of D123630: [WIP] Remove connection between 'ffast-math' and 'ffp-contract'..
Apr 12 2022, 1:39 PM · Restricted Project, Restricted Project
Herald added a project to D119290: [Clang] Add support for -fcx-limited-range, -fcx-fortran-rules options.: Restricted Project.
Apr 12 2022, 7:18 AM · Restricted Project, Restricted Project

Apr 5 2022

zahiraam committed rG4d165ad7d9b3: In fast-math mode, when unsafe math optimizations are enabled, the (authored by zahiraam).
In fast-math mode, when unsafe math optimizations are enabled, the
Apr 5 2022, 4:58 AM · Restricted Project, Restricted Project
zahiraam closed D122155: Add warning when eval-method is set in the presence of value unsafe floating-point calculations..
Apr 5 2022, 4:58 AM · Restricted Project, Restricted Project

Apr 4 2022

zahiraam updated the diff for D122155: Add warning when eval-method is set in the presence of value unsafe floating-point calculations..
Apr 4 2022, 6:46 AM · Restricted Project, Restricted Project

Apr 3 2022

zahiraam requested review of D122992: Remove wrong warning. Fix for https://github.com/llvm/llvm-project/issues/54625 .
Apr 3 2022, 4:59 AM · Restricted Project, Restricted Project
zahiraam updated the diff for D122155: Add warning when eval-method is set in the presence of value unsafe floating-point calculations..
Apr 3 2022, 4:47 AM · Restricted Project, Restricted Project

Apr 1 2022

zahiraam updated the diff for D122155: Add warning when eval-method is set in the presence of value unsafe floating-point calculations..
Apr 1 2022, 8:10 AM · Restricted Project, Restricted Project
zahiraam updated the diff for D122155: Add warning when eval-method is set in the presence of value unsafe floating-point calculations..
Apr 1 2022, 6:59 AM · Restricted Project, Restricted Project

Mar 29 2022

zahiraam updated the diff for D122155: Add warning when eval-method is set in the presence of value unsafe floating-point calculations..
Mar 29 2022, 11:22 AM · Restricted Project, Restricted Project

Mar 28 2022

zahiraam updated the diff for D122155: Add warning when eval-method is set in the presence of value unsafe floating-point calculations..
Mar 28 2022, 8:31 AM · Restricted Project, Restricted Project

Mar 25 2022

zahiraam updated the diff for D122155: Add warning when eval-method is set in the presence of value unsafe floating-point calculations..
Mar 25 2022, 6:43 AM · Restricted Project, Restricted Project

Mar 23 2022

zahiraam added inline comments to D122155: Add warning when eval-method is set in the presence of value unsafe floating-point calculations..
Mar 23 2022, 1:37 PM · Restricted Project, Restricted Project
zahiraam added a comment to D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled..

Hello. We've got some problem in our downstream tests after this patch and I'm trying to figure out how things are supposed to work. Maybe someone being part of this review knows.

Sorry for the troubles!

Problem is that we have some libc verification suites that include test cases using float_t. But in math.h from for example newlib the type float_t isn't defined if FLT_EVAL_METHOD is set to -1.
The standard says that float_t is implementation defined when FLT_EVAL_METHOD isn't 0/1/2. But I'm not quite sure how that is supposed to be handled (such as where to define float_t if not in math.h).

The way I read the requirements in C2x 7.12p3 are that the types float_t and double_t are always defined in <math.h>, but in the event FLT_EVAL_METHOD isn't 0, 1, or 2, the implementation has to pick whatever type makes the most sense for the underlying types.

One question is: If I have a piece of C99 code using float_t, is that code not allowed to be compiled using fast-math?

The standard doesn't admit that fast math is a thing; it's up to the implementations to define what their fast math extension does.

I guess it should be seen as with fast-math the float_t precision is unknown. But the type still has to be defined somewhere or else the frontend will complain about "unknown type name". But I'm not sure where this is supposed to be handled.

I think it should still be handled in <math.h>. *I am not a C floating point expert, so take this suggestion with a grain of salt*: I think it is defensible to fallback to defining float_t as float and double_t as double when the eval method is indeterminable. @andrew.w.kaylor may have more nuanced thoughts here.

Mar 23 2022, 7:05 AM · Restricted Project, Restricted Project
zahiraam added a reverting change for rG56d46b36fc23: [clang] roll-forward "[clang] Mark `trivial_abi` types as "trivially…: rGb0bc93da926a: Revert "[clang] roll-forward "[clang] Mark `trivial_abi` types as "trivially….
Mar 23 2022, 4:54 AM
zahiraam committed rGb0bc93da926a: Revert "[clang] roll-forward "[clang] Mark `trivial_abi` types as "trivially… (authored by zahiraam).
Revert "[clang] roll-forward "[clang] Mark `trivial_abi` types as "trivially…
Mar 23 2022, 4:54 AM · Restricted Project
zahiraam added a reverting change for D119017: [clang] roll-forward "[clang] Mark `trivial_abi` types as "trivially relocatable"".: rGb0bc93da926a: Revert "[clang] roll-forward "[clang] Mark `trivial_abi` types as "trivially….
Mar 23 2022, 4:54 AM · Restricted Project, Restricted Project

Mar 22 2022

zahiraam added inline comments to D122155: Add warning when eval-method is set in the presence of value unsafe floating-point calculations..
Mar 22 2022, 12:27 PM · Restricted Project, Restricted Project
zahiraam added inline comments to D122155: Add warning when eval-method is set in the presence of value unsafe floating-point calculations..
Mar 22 2022, 11:53 AM · Restricted Project, Restricted Project
zahiraam updated the diff for D122155: Add warning when eval-method is set in the presence of value unsafe floating-point calculations..
Mar 22 2022, 11:52 AM · Restricted Project, Restricted Project
zahiraam updated the diff for D122155: Add warning when eval-method is set in the presence of value unsafe floating-point calculations..
Mar 22 2022, 6:46 AM · Restricted Project, Restricted Project
zahiraam updated the summary of D122155: Add warning when eval-method is set in the presence of value unsafe floating-point calculations..
Mar 22 2022, 6:45 AM · Restricted Project, Restricted Project

Mar 21 2022

zahiraam added inline comments to D122155: Add warning when eval-method is set in the presence of value unsafe floating-point calculations..
Mar 21 2022, 12:25 PM · Restricted Project, Restricted Project
zahiraam requested review of D122155: Add warning when eval-method is set in the presence of value unsafe floating-point calculations..
Mar 21 2022, 9:34 AM · Restricted Project, Restricted Project
zahiraam added a comment to D118837: Methods visited for a special class must have an identifier..

Was this one submitted?

Mar 21 2022, 4:38 AM · Restricted Project, Restricted Project

Mar 17 2022

zahiraam committed rGbbf0d1932a3c: Currently the control of the eval-method is mixed with fast-math. (authored by zahiraam).
Currently the control of the eval-method is mixed with fast-math.
Mar 17 2022, 11:48 AM · Restricted Project
zahiraam closed D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled..
Mar 17 2022, 11:48 AM · Restricted Project, Restricted Project
zahiraam updated the diff for D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled..
Mar 17 2022, 8:07 AM · Restricted Project, Restricted Project
zahiraam updated the diff for D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled..
Mar 17 2022, 7:02 AM · Restricted Project, Restricted Project

Mar 11 2022

zahiraam updated the diff for D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled..
Mar 11 2022, 1:38 PM · Restricted Project, Restricted Project
zahiraam added inline comments to D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled..
Mar 11 2022, 1:34 PM · Restricted Project, Restricted Project
zahiraam updated the diff for D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled..
Mar 11 2022, 12:23 PM · Restricted Project, Restricted Project

Mar 10 2022

zahiraam committed rG15ef06f453c6: Diagnose when `#pragma clang fp eval_method` doesn't have a supported value. (authored by zahiraam).
Diagnose when `#pragma clang fp eval_method` doesn't have a supported value.
Mar 10 2022, 1:20 PM · Restricted Project
zahiraam closed D121380: Pragma `clang fp eval_method` needs to take as input a supported value..
Mar 10 2022, 1:20 PM · Restricted Project, Restricted Project
zahiraam added inline comments to D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled..
Mar 10 2022, 1:10 PM · Restricted Project, Restricted Project
zahiraam updated the diff for D121380: Pragma `clang fp eval_method` needs to take as input a supported value..
Mar 10 2022, 12:43 PM · Restricted Project, Restricted Project
zahiraam updated the diff for D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled..
Mar 10 2022, 12:32 PM · Restricted Project, Restricted Project
zahiraam updated the diff for D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled..
Mar 10 2022, 12:31 PM · Restricted Project, Restricted Project
zahiraam added inline comments to D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled..
Mar 10 2022, 11:12 AM · Restricted Project, Restricted Project
zahiraam updated the diff for D121380: Pragma `clang fp eval_method` needs to take as input a supported value..
Mar 10 2022, 10:28 AM · Restricted Project, Restricted Project
zahiraam updated the diff for D121380: Pragma `clang fp eval_method` needs to take as input a supported value..
Mar 10 2022, 9:57 AM · Restricted Project, Restricted Project
zahiraam requested review of D121380: Pragma `clang fp eval_method` needs to take as input a supported value..
Mar 10 2022, 8:17 AM · Restricted Project, Restricted Project

Mar 9 2022

zahiraam updated the diff for D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled..
Mar 9 2022, 2:11 PM · Restricted Project, Restricted Project

Mar 8 2022

zahiraam added inline comments to D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled..
Mar 8 2022, 2:25 PM · Restricted Project, Restricted Project
zahiraam updated the diff for D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled..
Mar 8 2022, 2:24 PM · Restricted Project, Restricted Project
zahiraam updated the summary of D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled..
Mar 8 2022, 2:24 PM · Restricted Project, Restricted Project

Mar 7 2022

zahiraam requested review of D121122: Set FLT_EVAL_METHOD to -1 when fast-math is enabled..
Mar 7 2022, 7:46 AM · Restricted Project, Restricted Project

Feb 23 2022

zahiraam committed rG1592d88aa7bc: Add support for floating-point option `ffp-eval-method` and for (authored by zahiraam).
Add support for floating-point option `ffp-eval-method` and for
Feb 23 2022, 3:00 PM

Feb 22 2022

zahiraam added a comment to D120155: FLT_EVAL_METHOD should always be set.

@MaskRay Thanks. Will do that.

Feb 22 2022, 11:16 AM
zahiraam added a comment to D120155: FLT_EVAL_METHOD should always be set.

Thanks @aaron.ballman

Feb 22 2022, 10:55 AM
zahiraam added a reviewer for D120155: FLT_EVAL_METHOD should always be set: erichkeane.
Feb 22 2022, 7:02 AM

Feb 20 2022

zahiraam updated the diff for D120155: FLT_EVAL_METHOD should always be set.
Feb 20 2022, 6:30 AM

Feb 18 2022

zahiraam requested review of D120155: FLT_EVAL_METHOD should always be set.
Feb 18 2022, 12:27 PM

Feb 17 2022

zahiraam committed rG4dfa68e48313: [NFC] Fix debug-info-hotpatch.cpp failure due to downstream regex issue. (authored by zahiraam).
[NFC] Fix debug-info-hotpatch.cpp failure due to downstream regex issue.
Feb 17 2022, 11:00 AM
zahiraam committed rG32b73bc6ab82: Add support for floating-point option `ffp-eval-method` and for (authored by zahiraam).
Add support for floating-point option `ffp-eval-method` and for
Feb 17 2022, 9:00 AM
zahiraam updated the summary of D120066: [NFC] Fix debug-info-hotpatch.cpp failure due to downstream regex issue..
Feb 17 2022, 8:54 AM · Restricted Project
zahiraam retitled D120066: [NFC] Fix debug-info-hotpatch.cpp failure due to downstream regex issue. from FileCheck’s regexp stumped on Windows. to [NFC] Fix debug-info-hotpatch.cpp failure due to downstream regex issue..
Feb 17 2022, 8:53 AM · Restricted Project
zahiraam updated the diff for D120066: [NFC] Fix debug-info-hotpatch.cpp failure due to downstream regex issue..
Feb 17 2022, 8:52 AM · Restricted Project
zahiraam requested review of D120066: [NFC] Fix debug-info-hotpatch.cpp failure due to downstream regex issue..
Feb 17 2022, 8:28 AM · Restricted Project

Feb 15 2022

zahiraam committed rG4bafe65c2b2f: Add support for floating-point option `ffp-eval-method` and for (authored by zahiraam).
Add support for floating-point option `ffp-eval-method` and for
Feb 15 2022, 1:59 PM

Feb 9 2022

zahiraam added a comment to D117569: Constexpr not supported with __declspec(dllimport)..

@majnemer Review please :)

Feb 9 2022, 12:53 PM · Restricted Project

Feb 8 2022

zahiraam committed rT6da025eb78f7: Getting previous behavior of FMA for SPEC2006 (authored by zahiraam).
Getting previous behavior of FMA for SPEC2006
Feb 8 2022, 7:22 AM

Feb 7 2022

zahiraam updated the diff for D117569: Constexpr not supported with __declspec(dllimport)..
Feb 7 2022, 6:50 AM · Restricted Project

Feb 3 2022

zahiraam updated the diff for D117569: Constexpr not supported with __declspec(dllimport)..
Feb 3 2022, 1:47 PM · Restricted Project

Feb 2 2022

zahiraam committed rGe692654a4dc0: The methods visited for a special class must have an identifier. (authored by zahiraam).
The methods visited for a special class must have an identifier.
Feb 2 2022, 1:13 PM
zahiraam requested review of D118837: Methods visited for a special class must have an identifier..
Feb 2 2022, 12:03 PM · Restricted Project, Restricted Project

Jan 31 2022

zahiraam added a comment to D117569: Constexpr not supported with __declspec(dllimport)..

@majnemer Any feedback please? thanks.

Jan 31 2022, 10:03 AM · Restricted Project
zahiraam updated the diff for D117569: Constexpr not supported with __declspec(dllimport)..
Jan 31 2022, 10:02 AM · Restricted Project

Jan 29 2022

zahiraam added a comment to D114483: [SYCL] Add support for sycl_special_class attribute.

Closed by 8ba9c794feb30cd969b9776c39873def10c51bff.

If the commit message contained Differential Revision:, the differential would be closely automatically when you pushed it to the git repo.
Please ensure the tag is contained next time. arc diff adds this tag automatically.

clang/include/clang/Basic/AttrDocs.td had some formatting issues and caused (-DLLVM_ENABLE_SPHINX=ON) ninja docs-clang-html to fail.
I fixed it. Please test this build target for .rst and AttrDocs.td changes.

@MaskRay OK thanks. I see other clang-format issues. Should those be fixed too?

The issues aren't from clang-format, they're from the RST file contents not building in sphinx due to formatting issues in AttrDocs.td.

https://lab.llvm.org/buildbot/#/builders/92/builds/20791/steps/5/logs/stdio
https://lab.llvm.org/buildbot/#/builders/92/builds/21098/steps/5/logs/stdio

are two such examples that stem from your patch. Basically, you have to build the attribute documentation (converting AttrDocs.td into AttributeReference.rst) and then build the sphinx documents locally to ensure you're not introducing new issues. Or, you can try to speculatively fix based on the errors the bot gives you, but sometimes those errors are super cryptic and take multiple tries to fix (like the "can't lex as C++" one above), which is why trying to reproduce locally is a good first step.

I've pushed a fix for it in a10ff373ddfa82a67c580a87f6258aa6ab8dd595 and the sphinx builder is happy again.

Jan 29 2022, 6:47 AM · Restricted Project
zahiraam added a comment to D114483: [SYCL] Add support for sycl_special_class attribute.

Closed by 8ba9c794feb30cd969b9776c39873def10c51bff.

If the commit message contained Differential Revision:, the differential would be closely automatically when you pushed it to the git repo.
Please ensure the tag is contained next time. arc diff adds this tag automatically.

clang/include/clang/Basic/AttrDocs.td had some formatting issues and caused (-DLLVM_ENABLE_SPHINX=ON) ninja docs-clang-html to fail.
I fixed it. Please test this build target for .rst and AttrDocs.td changes.

@MaskRay OK thanks. I see other clang-format issues. Should those be fixed too?

Jan 29 2022, 6:15 AM · Restricted Project

Jan 26 2022

zahiraam updated the diff for D117569: Constexpr not supported with __declspec(dllimport)..
Jan 26 2022, 12:18 PM · Restricted Project
zahiraam updated the diff for D117569: Constexpr not supported with __declspec(dllimport)..
Jan 26 2022, 11:38 AM · Restricted Project

Jan 25 2022

zahiraam committed rG8ba9c794feb3: Add support for sycl_special_class attribute. (authored by zahiraam).
Add support for sycl_special_class attribute.
Jan 25 2022, 2:17 PM
zahiraam added a comment to D114483: [SYCL] Add support for sycl_special_class attribute.

Thanks for the reviews.

Jan 25 2022, 7:05 AM · Restricted Project
zahiraam updated the diff for D114483: [SYCL] Add support for sycl_special_class attribute.
Jan 25 2022, 7:05 AM · Restricted Project
zahiraam updated the diff for D114483: [SYCL] Add support for sycl_special_class attribute.
Jan 25 2022, 4:39 AM · Restricted Project

Jan 24 2022

zahiraam updated the diff for D114483: [SYCL] Add support for sycl_special_class attribute.
Jan 24 2022, 2:08 PM · Restricted Project
zahiraam added inline comments to D114483: [SYCL] Add support for sycl_special_class attribute.
Jan 24 2022, 12:00 PM · Restricted Project
zahiraam added a comment to D117569: Constexpr not supported with __declspec(dllimport)..

@majnemer

I did take an example completely different with no use of the constexpr in order to understand (at least for me) when the _imp prefix is generated with CL.
This is sample.cpp:
#include<iostream>

__declspec(dllexport) void PrintHello()
{

std::cout << "hello" << std::endl;

}

$ cl sample.cpp /LD /EHsc
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27045 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

sample.cpp
Microsoft (R) Incremental Linker Version 14.16.27045.0
Copyright (C) Microsoft Corporation. All rights reserved.

/out:sample.dll
/dll
/implib:sample.lib
sample.obj

Creating library sample.lib and object sample.exp

$
This is testapp.cpp:
extern void __declspec(dllimport)PrintHello();

void main()
{

PrintHello();

}

$ cl testapp.cpp /EHsc /link sample.lib
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27045 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

testapp.cpp
Microsoft (R) Incremental Linker Version 14.16.27045.0
Copyright (C) Microsoft Corporation. All rights reserved.

/out:testapp.exe
sample.lib
testapp.obj
$
$ dumpbin /symbols testapp.obj | grep imp
008 00000000 UNDEF notype External | imp_?PrintHello@@YAXXZ (declspec(dllimport) void __cdecl PrintHello(void))
$

My understanding that the _imp prefix is generated because of the dllimport in testapp.cpp.
So if we go back to the test case above:

extern int __declspec(dllimport) dll_import_int;
constexpr int& dll_import_constexpr_ref = dll_import_int;
int& get() {

return dll_import_constexpr_ref;

}
int main () {

get();
return 0;

}

CLANG (with this patch and ICL for that matter) generates the symbol:

011 00000000 UNDEF notype External | imp_?dll_import_int@@3HA (declspec(dllimport) int dll_import_int)

but not MSVC. This seems incorrect to me since the _imp prefix is always generated for dllimport symbols?

Jan 24 2022, 7:59 AM · Restricted Project

Jan 21 2022

zahiraam added a comment to D117569: Constexpr not supported with __declspec(dllimport)..

I did take an example completely different with no use of the constexpr in order to understand (at least for me) when the _imp prefix is generated with CL.
This is sample.cpp:
#include<iostream>

Jan 21 2022, 2:25 PM · Restricted Project

Jan 20 2022

zahiraam added a comment to D117569: Constexpr not supported with __declspec(dllimport)..

Your example is different from mine as it nests the constexpr variable inside the function rather than having it at translation-unit scope.

Jan 20 2022, 6:19 PM · Restricted Project
zahiraam added a comment to D117569: Constexpr not supported with __declspec(dllimport)..

I have a question regarding how this work with respect to the dllimport semantics known by the linker.
IIUC, we will now allow a program like:

extern int __declspec(dllimport) dll_import_int;
constexpr int& dll_import_constexpr_ref = dll_import_int;
int& get() {
    return dll_import_constexpr_ref;
}

Here, get will load dll_import_constexpr_ref. However, what will dll_import_constexpr_ref hold? It ought to hold the contents of __imp_?dll_import_int@@3HA. However, we can't dereference __imp_?dll_import_int@@3HA to get to its contents.

@majnemer Thanks for the review.

This test case doesn't link with MSVC. It will generate this error:
Microsoft (R) Incremental Linker Version 14.29.30133.0
Copyright (C) Microsoft Corporation. All rights reserved.

/out:test1.exe
test1.obj
test1.obj : error LNK2001: unresolved external symbol "int dll_import_int" (?dll_import_int@@3HA)
test1.exe : fatal error LNK1120: 1 unresolved externals

The symbols generated with MSVC are:
07 00000000 UNDEF notype External | ?dll_import_int@@3HA (int dll_import_int)
015 00000000 SECT6 notype Static | ?dll_import_constexpr_ref@@3AEAHEA (int & dll_import_constexpr_ref)

Without this patch this test case errors. With this patch clang will generate these symbols:

010 00000000 UNDEF notype External | imp_?dll_import_int@@3HA (declspec(dllimport) int dll_import_int)
012 00000000 SECT5 notype External | ?dll_import_constexpr_ref@@3AEAHEA (int & dll_import_constexpr_ref)
013 00000000 UNDEF notype External | ?dll_import_int@@3HA (int dll_import_int)

and will error at link time with this error:
test1-f1f63b.o : error LNK2019: unresolved external symbol "declspec(dllimport) int dll_import_int" (imp_?dll_import_int@@3HA) referenced in function "int & __cdecl get(void)" (?get@@YAAEAHXZ)
test1-f1f63b.o : error LNK2001: unresolved external symbol "int dll_import_int" (?dll_import_int@@3HA)
a.exe : fatal error LNK1120: 2 unresolved externals

I think that's the behavior expected, right?

My interpretation is that MSVC has a bug: it is forming a reference to ?dll_import_int@@3HA and not __imp_?dll_import_int@@3HA. Could you run a more complete experiment where you have a dll which exports the symbol and you try to import it?

Jan 20 2022, 3:13 PM · Restricted Project
zahiraam updated the diff for D117569: Constexpr not supported with __declspec(dllimport)..
Jan 20 2022, 8:00 AM · Restricted Project
zahiraam added a comment to D117569: Constexpr not supported with __declspec(dllimport)..

I have a question regarding how this work with respect to the dllimport semantics known by the linker.
IIUC, we will now allow a program like:

extern int __declspec(dllimport) dll_import_int;
constexpr int& dll_import_constexpr_ref = dll_import_int;
int& get() {
    return dll_import_constexpr_ref;
}

Here, get will load dll_import_constexpr_ref. However, what will dll_import_constexpr_ref hold? It ought to hold the contents of __imp_?dll_import_int@@3HA. However, we can't dereference __imp_?dll_import_int@@3HA to get to its contents.

Jan 20 2022, 7:45 AM · Restricted Project

Jan 19 2022

zahiraam updated the diff for D117569: Constexpr not supported with __declspec(dllimport)..
Jan 19 2022, 2:59 PM · Restricted Project

Jan 18 2022

zahiraam requested review of D117569: Constexpr not supported with __declspec(dllimport)..
Jan 18 2022, 8:52 AM · Restricted Project

Jan 14 2022

zahiraam added a comment to D114483: [SYCL] Add support for sycl_special_class attribute.

@Fznamznon @bader @Naghasan reviews please? Thanks.

Jan 14 2022, 9:54 AM · Restricted Project

Jan 4 2022

zahiraam added a comment to D76038: PR45000: Let Sema::SubstParmVarDecl handle default args of lambdas in initializers.

This change is generating this crash discussed here: https://bugs.llvm.org/show_bug.cgi?id=49834
@aaronpuchert do you have any fix for it?

Jan 4 2022, 5:30 AM · Restricted Project, Restricted Project