File tree 2 files changed +20
-2
lines changed
2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -2695,15 +2695,26 @@ bool ByteCodeExprGen<Emitter>::VisitCXXUuidofExpr(const CXXUuidofExpr *E) {
2695
2695
return true ;
2696
2696
assert (!Initializing);
2697
2697
2698
- std::optional<unsigned > GlobalIndex = P.getOrCreateGlobal (E->getGuidDecl ());
2698
+ const MSGuidDecl *GuidDecl = E->getGuidDecl ();
2699
+ const RecordDecl *RD = GuidDecl->getType ()->getAsRecordDecl ();
2700
+ assert (RD);
2701
+ // If the definiton of the result type is incomplete, just return a dummy.
2702
+ // If (and when) that is read from, we will fail, but not now.
2703
+ if (!RD->isCompleteDefinition ()) {
2704
+ if (std::optional<unsigned > I = P.getOrCreateDummy (GuidDecl))
2705
+ return this ->emitGetPtrGlobal (*I, E);
2706
+ return false ;
2707
+ }
2708
+
2709
+ std::optional<unsigned > GlobalIndex = P.getOrCreateGlobal (GuidDecl);
2699
2710
if (!GlobalIndex)
2700
2711
return false ;
2701
2712
if (!this ->emitGetPtrGlobal (*GlobalIndex, E))
2702
2713
return false ;
2703
2714
2704
2715
assert (this ->getRecord (E->getType ()));
2705
2716
2706
- const APValue &V = E-> getGuidDecl () ->getAsAPValue ();
2717
+ const APValue &V = GuidDecl ->getAsAPValue ();
2707
2718
if (V.getKind () == APValue::None)
2708
2719
return true ;
2709
2720
Original file line number Diff line number Diff line change 4
4
// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-pc-linux -fms-extensions | FileCheck %s --check-prefix=CHECK-64
5
5
// RUN: %clang_cc1 -emit-llvm %s -o - -DDEFINE_GUID -DWRONG_GUID -triple=i386-pc-linux -fms-extensions | FileCheck %s --check-prefix=CHECK-DEFINE-WRONG-GUID
6
6
7
+ // / The same, but with the new constant interpreter.
8
+ // RUN: %clang_cc1 -fexperimental-new-constant-interpreter -emit-llvm %s -o - -DDEFINE_GUID -triple=i386-pc-linux -fms-extensions | FileCheck %s --check-prefix=CHECK-DEFINE-GUID
9
+ // RUN: %clang_cc1 -fexperimental-new-constant-interpreter -emit-llvm %s -o - -DDEFINE_GUID -DBRACKET_ATTRIB -triple=i386-pc-linux -fms-extensions | FileCheck %s --check-prefix=CHECK-DEFINE-GUID
10
+ // RUN: %clang_cc1 -fexperimental-new-constant-interpreter -emit-llvm %s -o - -triple=i386-pc-linux -fms-extensions | FileCheck %s
11
+ // RUN: %clang_cc1 -fexperimental-new-constant-interpreter -emit-llvm %s -o - -triple=x86_64-pc-linux -fms-extensions | FileCheck %s --check-prefix=CHECK-64
12
+ // RUN: %clang_cc1 -fexperimental-new-constant-interpreter -emit-llvm %s -o - -DDEFINE_GUID -DWRONG_GUID -triple=i386-pc-linux -fms-extensions | FileCheck %s --check-prefix=CHECK-DEFINE-WRONG-GUID
13
+
7
14
#ifdef DEFINE_GUID
8
15
struct _GUID {
9
16
#ifdef WRONG_GUID
You can’t perform that action at this time.
0 commit comments