diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 6 | ||||
-rw-r--r-- | clang/test/CodeGenObjC/debug-info-property4.m | 17 |
2 files changed, 21 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index addc254128a..9a0121ea50c 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -233,7 +233,8 @@ llvm::DIFile CGDebugInfo::getOrCreateMainFile() { /// getLineNumber - Get line number for the location. If location is invalid /// then use current location. unsigned CGDebugInfo::getLineNumber(SourceLocation Loc) { - assert((Loc.isValid() || CurLoc.isValid()) && "Invalid current location!"); + if (Loc.isInvalid() && CurLoc.isInvalid()) + return 0; SourceManager &SM = CGM.getContext().getSourceManager(); PresumedLoc PLoc = SM.getPresumedLoc(Loc.isValid() ? Loc : CurLoc); return PLoc.isValid()? PLoc.getLine() : 0; @@ -242,7 +243,8 @@ unsigned CGDebugInfo::getLineNumber(SourceLocation Loc) { /// getColumnNumber - Get column number for the location. If location is /// invalid then use current location. unsigned CGDebugInfo::getColumnNumber(SourceLocation Loc) { - assert((Loc.isValid() || CurLoc.isValid()) && "Invalid current location!"); + if (Loc.isInvalid() && CurLoc.isInvalid()) + return 0; SourceManager &SM = CGM.getContext().getSourceManager(); PresumedLoc PLoc = SM.getPresumedLoc(Loc.isValid() ? Loc : CurLoc); return PLoc.isValid()? PLoc.getColumn() : 0; diff --git a/clang/test/CodeGenObjC/debug-info-property4.m b/clang/test/CodeGenObjC/debug-info-property4.m new file mode 100644 index 00000000000..619813f6879 --- /dev/null +++ b/clang/test/CodeGenObjC/debug-info-property4.m @@ -0,0 +1,17 @@ +// RUN: %clang_cc1 -fobjc-default-synthesize-properties -masm-verbose -S -g %s -o - | FileCheck %s + +// CHECK: AT_APPLE_property_name +// CHECK: AT_APPLE_property_getter +// CHECK: AT_APPLE_property_setter +// CHECK: AT_APPLE_property_attribute +// CHECK: AT_APPLE_property + + +@interface I1 +@property int p1; +@end + +@implementation I1 +@end + +void foo(I1 *ptr) {} |