================
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -foverflow-behavior-types -std=c++11 -ast-print %s -o - | 
FileCheck %s
+
+extern int __attribute__((overflow_behavior(no_wrap))) a;
+extern int __attribute__((overflow_behavior(wrap))) b;
+
+// CHECK: extern __no_wrap int a;
+// CHECK: extern __wrap int b;
----------------
JustinStitt wrote:

I am not inheriting from `AttributedType`. These overflow behavior types are 
being turned directly into a canonical OBT.

```c
typedef int __attribute__((overflow_behavior(no_wrap))) nw_int;
...
`-TypedefDecl 0x55d0afc0d998 <line:4:1, col:57> col:57 nw_int 'int 
__attribute__((overflow_behavior(no_wrap)))'
  `-OverflowBehaviorType 0x55d0afc0d7b0 'int 
__attribute__((overflow_behavior(no_wrap)))'
    `-BuiltinType 0x55d0afba5000 'int'
```

Also, to get the argument (behavior kind) to appear I believe we need to do 
this manually -- like what is done for 
`TypePrinter::printBTFTagAttributedBefore()`. This let's me get 
`overflow_behavior(no_wrap)` or `overflow_behavior(wrap)` printed out.

So to summarize, I'm not sure if I can re-use the `AttributedType` handling for 
OBTs and even if we could, I'd still need to manually re-insert the behavior 
kind.

https://github.com/llvm/llvm-project/pull/148914
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to