[cfe-commits] r141512 - /cfe/trunk/lib/Sema/SemaType.cpp

Douglas Gregor dgregor at apple.com
Sun Oct 9 11:45:17 PDT 2011


Author: dgregor
Date: Sun Oct  9 13:45:17 2011
New Revision: 141512

URL: http://llvm.org/viewvc/llvm-project?rev=141512&view=rev
Log:
When building source location information for an _Atomic type, be sure
to fill in the source locations for the underlying value type. Fixes
an intermittent crasher (due to uninitialized data) in the PCH test
for _Atomic types.


Modified:
    cfe/trunk/lib/Sema/SemaType.cpp

Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=141512&r1=141511&r2=141512&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Sun Oct  9 13:45:17 2011
@@ -2885,6 +2885,10 @@
     void VisitAtomicTypeLoc(AtomicTypeLoc TL) {
       TL.setKWLoc(DS.getTypeSpecTypeLoc());
       TL.setParensRange(DS.getTypeofParensRange());
+      
+      TypeSourceInfo *TInfo = 0;
+      Sema::GetTypeFromParser(DS.getRepAsType(), &TInfo);
+      TL.getValueLoc().initializeFullCopy(TInfo->getTypeLoc());
     }
 
     void VisitTypeLoc(TypeLoc TL) {





More information about the cfe-commits mailing list