Set DW_AT_artificial only if argument is marked as artificial.
[oota-llvm.git] / include / llvm / Analysis / DebugInfo.h
index 331a89b0e2f7da410769f8052915ed5780e28178..ccf0105c210039735265973c536093e64e72c372 100644 (file)
@@ -193,7 +193,9 @@ namespace llvm {
       FlagFwdDecl          = 1 << 2,
       FlagAppleBlock       = 1 << 3,
       FlagBlockByrefStruct = 1 << 4,
-      FlagVirtual          = 1 << 5
+      FlagVirtual          = 1 << 5,
+      FlagArtificial       = 1 << 6  // To identify artificial arguments in
+                                     // a subroutine type. e.g. "this" in c++.
     };
 
   protected:
@@ -241,6 +243,9 @@ namespace llvm {
     bool isVirtual() const {
       return (getFlags() & FlagVirtual) != 0;
     }
+    bool isArtificial() const {
+      return (getFlags() & FlagArtificial) != 0;
+    }
 
     /// dump - print type.
     void dump() const;
@@ -574,6 +579,9 @@ namespace llvm {
                                         unsigned RunTimeLang = 0,
                                         MDNode *ContainingType = 0);
 
+    /// CreateArtificialType - Create a new DIType with "artificial" flag set.
+    DIType CreateArtificialType(DIType Ty);
+
     /// CreateCompositeType - Create a composite type like array, struct, etc.
     DICompositeType CreateCompositeTypeEx(unsigned Tag, DIDescriptor Context,
                                         StringRef Name,